Skip to content

French dataset can't be queried with columns with spaces #1

@MyNameIsCalvinDavis

Description

@MyNameIsCalvinDavis
query = "SELECT `COMMUNE RECENSEE (R si recensée)` from francetax;"
client.query(query)

When selecting a random column like the one above, the following error is produced:

---------------------------------------------------------------------------
ParserException                           Traceback (most recent call last)
Cell In[240], line 2
      1 query = "SELECT `COMMUNE RECENSEE (R si recensée)` from francetax;"
----> 2 client.query(query)

File [~\Notebooks\French](http://localhost:8888/lab/tree/Notebooks/French%20Finance/datasharing/notebooks/~/Notebooks/French) Finance\datasharing\datasharing\datasharing.py:215, in DataSharingClient.query(self, query, new_table_name)
    213     print(f"Table {new_table_name} created from query.")
    214 else:
--> 215     result_df = self.conn.execute(query).fetchdf()
    216     print(f"Query: {query}")
    217     return result_df

ParserException: Parser Error: syntax error at or near "("

Is there a different way to access these columns? Otherwise I will be forced to just load the whole dataset into a single dataframe.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions