Skip to content

Commit

Permalink
Use dictionary access to get fields from table objects
Browse files Browse the repository at this point in the history
Property access fails e,g, for columns named values
(See OpenEnergyPlatform/oedialect#18)
  • Loading branch information
MGlauer committed Jun 25, 2019
1 parent 4b1aea3 commit 79f60c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ def parse_column(d, mapper):
else:
schema_name = None
table = load_table_from_metadata(table_name, schema_name=schema_name)
if table is not None and hasattr(table.c, name):
return getattr(table.c, name)
if table is not None and name in table.c:
return table.c[name]
else:
if is_literal:
return literal_column(name)
Expand Down

0 comments on commit 79f60c7

Please sign in to comment.