Search code examples
pythonpandaslistrdbmsparquet

What parameter do i use in pd.read_sql_query() to update the column list instead of "column" in pd.read_parquet(columns = list())


According to pandas documentation -

columnslist, default=None If not None, only these columns will be read from the file.

Eg - pd.read_parquet(columns = list(abc))

Similarly i want a replacement of the "columns" attribute while reading from pd.read_sql_query()

Thanks in advance!


Solution

  • Instead of using pd.read_sql_query()

    You can use -

    self.df = pd.read_sql(columns=list(values))