Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Odo 0.5.0 is incompatible with networkx 2.0 on Windows #579

Open
mcquin opened this issue Sep 22, 2017 · 5 comments
Open

Odo 0.5.0 is incompatible with networkx 2.0 on Windows #579

mcquin opened this issue Sep 22, 2017 · 5 comments

Comments

@mcquin
Copy link

mcquin commented Sep 22, 2017

odo.odo fails on Windows when inserting a CSV file into a (sqlite) database due to networkx 2.0.

  • Windows 10
  • Python 2.7.14

odo (and networkx) installed/upgraded via command pip install --upgrade odo.

test file

odo 0.5.0 with networkx 2.0:

Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import odo
C:\Python27\lib\site-packages\odo\backends\pandas.py:94: FutureWarning: pandas.tslib is deprecated and will be removed i
n a future version.
You can access NaTType as type(pandas.NaT)
  @convert.register((pd.Timestamp, pd.Timedelta), (pd.tslib.NaTType, type(None)))
>>> odo.odo("pets.csv", "sqlite:///foo.db::Pets")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\odo\odo.py", line 91, in odo
    return into(target, source, **kwargs)
  File "C:\Python27\lib\site-packages\multipledispatch\dispatcher.py", line 164, in __call__
    return func(*args, **kwargs)
  File "C:\Python27\lib\site-packages\odo\into.py", line 43, in wrapped
    return f(*args, **kwargs)
  File "C:\Python27\lib\site-packages\odo\into.py", line 149, in into_string_string
    return into(a, resource(b, **kwargs), **kwargs)
  File "C:\Python27\lib\site-packages\multipledispatch\dispatcher.py", line 164, in __call__
    return func(*args, **kwargs)
  File "C:\Python27\lib\site-packages\odo\into.py", line 43, in wrapped
    return f(*args, **kwargs)
  File "C:\Python27\lib\site-packages\odo\into.py", line 143, in into_string
    return into(a, b, dshape=dshape, **kwargs)
  File "C:\Python27\lib\site-packages\multipledispatch\dispatcher.py", line 164, in __call__
    return func(*args, **kwargs)
  File "C:\Python27\lib\site-packages\odo\into.py", line 43, in wrapped
    return f(*args, **kwargs)
  File "C:\Python27\lib\site-packages\odo\into.py", line 131, in into_object
    return append(target, source, dshape=dshape, **kwargs)
  File "C:\Python27\lib\site-packages\multipledispatch\dispatcher.py", line 171, in __call__
    return func(*args, **kwargs)
  File "C:\Python27\lib\site-packages\odo\backends\sql.py", line 493, in append_anything_to_sql_Table
    return append(t, convert(Iterator, o, **kwargs), **kwargs)
  File "C:\Python27\lib\site-packages\odo\core.py", line 44, in __call__
    return _transform(self.graph, *args, **kwargs)
  File "C:\Python27\lib\site-packages\odo\core.py", line 57, in _transform
    ooc_types=ooc_types)
  File "C:\Python27\lib\site-packages\odo\core.py", line 94, in path
    for src, tgt in zip(pth, pth[1:])]
AttributeError: 'SubDiGraph' object has no attribute 'edge'
>>> quit()

odo 0.5.0 with networkx 1.11:

Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import odo
C:\Python27\lib\site-packages\odo\backends\pandas.py:94: FutureWarning: pandas.tslib is deprecated and will be removed i
n a future version.
You can access NaTType as type(pandas.NaT)
  @convert.register((pd.Timestamp, pd.Timedelta), (pd.tslib.NaTType, type(None)))
>>> odo.odo("pets.csv", "sqlite:///foo.db::Pets")
Table('Pets', MetaData(bind=Engine(sqlite:///foo.db)), Column('Cats', BIGINT(), table=<Pets>, nullable=False), Column('D
ogs', BIGINT(), table=<Pets>, nullable=False), schema=None)
>>> quit()

This does not appear to be a problem on OS X. I have not verified the behavior on Linux.

@agravier
Copy link

This is also a problem on Linux (Ubuntu 16.04, x64) with networkx 2.0 as installed as a dependency of odo. Like for mcquin, it works when downgrading to 1.11.

@Konubinix
Copy link

I confirm the issue and the fact that downgrading works for the present.

@asokadiggs
Copy link

I found this Migration Guide talking about transitioning support for networkx 1.x to networkx 2.x.

https://networkx.github.io/documentation/latest/release/migration_guide_from_1.x_to_2.0.html

The key bit for the error I saw is quoted here:
"Replace any use of G.edge with G.adj. The Graph attribute edge has been removed. The attribute G.adj is G.edge in v1 and will work with both versions."

I don't know the odo source code well enough to submit a meaningful pull request. I did make this one edit in my local copy of core.py in the path function, and the error DiGraph object has no attribute 'edge' went away.

@rizplate
Copy link

I am getting this error


odo((1, 2, 3), list)

AttributeError: 'DiGraph' object has no attribute 'edge'```

@eronsdc
Copy link

eronsdc commented Nov 7, 2018

I was getting this error similar to @rizplate

AttributeError: 'SubDiGraph' object has no attribute 'edge'

dowgrading to 1.11 with anaconda on windows seemed to work as suggested by @mcquin. Or at least, I get a different error now (#605 for the curious)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants