How to be more explicit when referencing Python objects in SQL #9114
davetapley
started this conversation in
Ideas
Replies: 2 comments 4 replies
This comment was marked as disruptive content.
This comment was marked as disruptive content.
-
See also: I've also found another awkward situation with a pattern I use sometimes: @dataclass
class StoreData:
data: DataFrame
def store(self, con: DuckDBPyConnection):
data = self.data
con.execute('query using data') Problem is tools like pylint and pyright complain that |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Building on this example I'm often moving data from Python to DuckDB like this:
But I've been caught out a couple of times where my table and my DataFrame have the same name, e.g.:
I've only caught these through unit testing because it doesn't fail, it just inserts zero rows (presumably the query planner is picking
people
the table beforepeople
the Python variable).Is there some existing way to be more explicit that I'm referencing the Python variable name and not the table name?
Beta Was this translation helpful? Give feedback.
All reactions