Closed tlastowka closed 7 years ago
Hi, I think, don't blame your environnement, blame the master branch ^^ ... I don't get enough time to work on it, and there's been regressions in the last few commits in the master. I'm looking into it, the 0.2 version on pypi should be functional enough, I hope. Sorry about that, AFAIK the error is shown, I've overloaded hash to sort/compare entities/transactions etc, and apparently it's not working well... Thanks for the report and sorry about the inconvenience.
No worries! It just seemed like a nice way to automate some things I deal with in ynab manually right now. That anyone is working on this stuff at all is great!
For what its worth, I don't think this issue appeared in 0.3. I rolled a clean environment and installed 0.2 from pypi and still get the same error. Still, think this thing is neat!
Traceback (most recent call last):
File "1.py", line 10, in <module>
client = clientfromargs(args)
File "/home/vagrant/venv/lib/python3.5/site-packages/pynYNAB/Client.py", line 17, in clientfromargs
client = nYnabClient(connection, budget_name=args.budgetname)
File "/home/vagrant/venv/lib/python3.5/site-packages/pynYNAB/Client.py", line 45, in __init__
self.sync()
File "/home/vagrant/venv/lib/python3.5/site-packages/pynYNAB/Client.py", line 71, in sync
self.budget.sync(self.connection, 'syncBudgetData')
File "/home/vagrant/venv/lib/python3.5/site-packages/pynYNAB/roots.py", line 61, in sync
self.update_from_changed_entities(changed_entities)
File "/home/vagrant/venv/lib/python3.5/site-packages/pynYNAB/Entity.py", line 173, in update_from_changed_entities
getattr(self, namefield).update_from_changed_entities(changed_entities.get(namefield))
File "/home/vagrant/venv/lib/python3.5/site-packages/pynYNAB/Entity.py", line 226, in update_from_changed_entities
self._update_hashes()
File "/home/vagrant/venv/lib/python3.5/site-packages/pynYNAB/Entity.py", line 199, in _update_hashes
self._dict_entities_hash = {hash(v): v for k, v in self._dict_entities.items()}
File "/home/vagrant/venv/lib/python3.5/site-packages/pynYNAB/Entity.py", line 199, in <dictcomp>
self._dict_entities_hash = {hash(v): v for k, v in self._dict_entities.items()}
TypeError: __hash__ method should return an integer
(venv) vagrant@vagrant:/vagrant$ pip freeze
aenum==1.4.5
appdirs==1.4.0
cchardet==1.1.1
click==6.6
ConfigArgParse==0.11.0
dateparser==0.5.0
enum34==1.1.6
et-xmlfile==1.0.1
ezodf==0.3.2
future==0.16.0
ijson==2.3
jdatetime==1.8.1
jdcal==1.3
jsonlines==1.1.0
jsonschema==2.5.1
jsontableschema==0.8.4
linear-tsv==1.0.0
lxml==3.7.0
ofxtools==0.3.13
openpyxl==2.4.1
pkg-resources==0.0.0
pynab==0.6.8
pynYNAB==0.2
python-dateutil==2.6.0
pytz==2016.10
regex==2016.11.21
requests==2.12.4
rfc3986==0.4.1
ruamel.yaml==0.13.4
schematics==1.1.1
six==1.10.0
tabulator==0.12.1
toolz==0.8.2
tzlocal==1.3
umalqurra==0.2
unicodecsv==0.14.1
xlrd==1.0.0
Hi tlastowka, What's the status of this issue with recent versions (the ones using sqlalchemy for object relation management) ?
The current version of the client seems to be crashing any time there the budget in question has any future transactions scheduled.
I want to believe this has something to do with my environment and not nYNABapi itself, but even when I stripped it down to a bare minimum script with a brand new minimal budget it seems to be the case. nYNABapi was installed this morning per the readme from the master branch.
I'm happy to provide additional data if needed.
Bare minimum script
Working: Sample budget with no future transaction
Not Working: The exact same budget with a transaction happening tomorrow.
Environment Information: