steemit / yo

Modular event-driven notification service
https://github.com/steemit/yo/issues/113
MIT License
7 stars 9 forks source link

Fix query in notification sender for run_notifications #100

Closed GwenNelson closed 6 years ago

GwenNelson commented 6 years ago

Getting following error:

E sqlalchemy.exc.ArgumentError: SQL expression object or string expected, got object of type <class 'list'> instead

This should probably be fixed after merging the following PR (since the fix needs to live in db.py): https://github.com/steemit/yo/pull/93

The problematic code is here: with self.db.acquire_conn() as conn: query = notifications_table.join(actions_table).select([notifications_table.c.notify_type, notifications_table.c.to_username, notifications_table.c.from_username, notifications_table.c.json_data, notifications_table.c.priority_level]) query = query.where(actions_table.c.nid == None) select_response = conn.execute(query) unsents = {} for row in select_response: if not row[1] in unsents.keys(): unsents[row[1]] = [] unsents[row[1]].append(dict(row.items()))

GwenNelson commented 6 years ago

eww, github swallowed the formatting in that code, but you get the idea

GwenNelson commented 6 years ago

PR #106 is awaiting merge