Dask : 'DataFrame' object has no attribute '_meta'

492 views Asked by At

I tried to connect Ms SQL server and loading dataframe into the SQL server, while connecting I keep on getting "no attribute '_meta'".

I am new to Dask Dataframe, can someone help me out. It would be very helpful.

Query:

dd.to_sql(df,name='Test_DD',
          uri = 'mssql+pyodbc://{'+USERNAME+'}:{'+PASSWORD+'}@{'+SERVER+'}/{'+DATABASE+'}?driver={'+DRIVER+'}?Trusted_Connection=yes')

Error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-81-50a6f69a8209> in <module>
      1 dd.to_sql(df,name='Test_DD',
----> 2           uri = 'mssql+pyodbc://{'+USERNAME+'}:{'+PASSWORD+'}@{'+SERVER+'}/{'+DATABASE+'}?driver={'+DRIVER+'}?Trusted_Connection=yes')

C:\Python\envs\poc\lib\site-packages\dask\dataframe\io\sql.py in to_sql(df, name, uri, schema, if_exists, index, index_label, chunksize, dtype, method, compute, parallel)
    379 
    380     make_meta = delayed(make_meta)
--> 381     meta_task = make_meta(df._meta)
    382 
    383     # Partitions should always append to the empty table created from `meta` above

C:\Python\envs\poc\lib\site-packages\pandas\core\generic.py in __getattr__(self, name)
   5272             if self._info_axis._can_hold_identifiers_and_holds_name(name):
   5273                 return self[name]
-> 5274             return object.__getattribute__(self, name)
   5275 
   5276     def __setattr__(self, name: str, value) -> None:

AttributeError: 'DataFrame' object has no attribute '_meta'
0

There are 0 answers