2016-10-16 4 views
1

Может кто-то с опытом работы с pygrametl пакетом в питона помочь мне понять ниже ошибки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 

ответ

0

Я не уверен, если это является причиной вашей проблемы, но вы не должны добавить ключ в атрибуты:

attributes: a sequence of the attribute names in the dimension table. Should not include the name of the primary key which is given in the key argument.

Источник: http://chrthomsen.github.io/pygrametl/doc/api/tables.html (см аргументы класса Dimension)

Смежные вопросы