我尝试连接 Ms SQL 服务器并将数据框加载到 SQL 服务器中,同时连接时我不断收到“无属性 '_meta'”。
我是 Dask Dataframe 的新手,有人可以帮帮我。这将非常有帮助。
询问:
dd.to_sql(df,name='Test_DD',
uri = 'mssql+pyodbc://{'+USERNAME+'}:{'+PASSWORD+'}@{'+SERVER+'}/{'+DATABASE+'}?driver={'+DRIVER+'}?Trusted_Connection=yes')
错误:
---------------------------------------------------------------------------
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'