Closed promethean closed 2 years ago
Also got this after updating dataset to latest 1.5.1 on previously worked code, changing row._mapping.items()
to row.items()
helped, but then I reverted it back and tried just to update sqlalchemy to latest and error disappeared (sqlalchemy during update also cried about some incompatible version of marshmallow, so updated it too, not sure this important, just in case).
if d := tt['text_merged_base'].find_one(image=image):
File "...\lib\site-packages\dataset\table.py", line 649, in find_one
for row in resiter:
File "...\lib\site-packages\dataset\util.py", line 87, in __next__
return convert_row(self.row_type, next(self._iter))
File "...\lib\site-packages\dataset\util.py", line 17, in convert_row
return row_type(row._mapping.items())
AttributeError: Could not locate column in row for column '_mapping'
P.S.: maybe some versions of supported libs should be changed, maybe this will help (yet I did not update things before in a long time, so maybe ranges of those libs could be expanded): sqlalchamy updated from 1.3.19 to latest (current 1.4.28)
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
marshmallow-sqlalchemy 0.24.0 requires marshmallow>=3.0.0, but you have marshmallow 2.21.0 which is incompatible.
so marshmallow updated from 2.21.0 to latest (current 3.14.1)
Just received the same issue. Happened when updated to 1.5.1. @pudo
Yep it looks like SQLAlchemy 1.4 has introduced a new result type: https://docs.sqlalchemy.org/en/14/core/connections.html#sqlalchemy.engine.Result - I'm kind of tempted to start tagging the versions of SQLAlchemy that dataset will work with... Going to try and work out a fix now.
Ok, so it looks like row._mapping
doesn't exist in sqlalchemy 1.3, exists in 1.4 and will be the default in 2.0. I've added some crappy ImportError
work-around now that should ensure it works with both 1.3 and 1.4.
@pudo thanks for quick help! Will you bump the updated version in pip?
should be available now :)
Looks a great library but hit a hurdle at the first attempt.
As per the v. basic Quickstart example here: https://dataset.readthedocs.io/en/latest/index.html
Throws an error:
AttributeError: Could not locate column in row for column '_mapping'
Referring to line: https://github.com/pudo/dataset/blob/8c91b6feaaeb92838ae8f2cee00ab71012d1c11f/dataset/util.py#L17
It returns the correct results if changed to return
row.items()
instead ofrow._mapping.items()