[英]pygrametl CSVSource TypeError: init() takes at least 2 arguments (1 given)
[英]pygrametl Dimension abstraction
在python中有pygrametl包經驗的人可以幫助我理解下面的錯誤
pygrametl文檔中的示例代碼:
productDimension = Dimension(
name='product',
key='productid',
attributes=['name', 'category', 'price'],
lookupatts=['name'])
我寫的代碼:
artist_dim=Dimension(
name='Artist_dim',
key='row_id',
attributes=['row_id','Artist_name','Artist_type','Country','ETL_BATCH_ID'],
lookupatts=['Artist_name']
)
錯誤:
Traceback (most recent call last):
File "artist_petl.py", line 40, in <module>
attributes=['row_id','Artist_name','Artist_type','Country','ETL_BATCH_ID']
File "C:\Anaconda3\lib\site-packages\pygrametl\tables.py", line 189, in __init__
(self.quote(key), name))
File "C:\Anaconda3\lib\site-packages\pygrametl\__init__.py", line 663, in execute
self.__cursor.execute(stmt, arguments)
TypeError: expecting a dictionary, sequence or keyword args
我不確定這是否是您的問題的原因,但您不應該將鍵添加到屬性 :
attributes :維度表中的屬性名稱序列。 不應包含key參數中給出的主鍵名稱。
來源: http : //chrthomsen.github.io/pygrametl/doc/api/tables.html (參見Dimension類參數)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.