0
我想定義一個Luigi任務,它將在AWS中的Postgres數據庫中創建一個表。我已經嘗試了不同的進口,如:Python - Luigi - 複製到Postgres
import luigi.contrib.postgres.CopyToTable
from luigi.contrib.postgres import CopyToTable
import luigi.contrib.postgres
from luigi.contrib import postgres
import luigi.postgres (i thing this is depreceated)
而且我收到了不同的錯誤,但總是相似的,如:
AttributeError: module 'luigi.contrib' has no attribute 'postgres'
ModuleNotFoundError: No module named 'luigi.contrib.postgres'
有誰知道這是什麼問題?我的任務是下一個:
class InsertToRDS(luigi.contrib.postgres.CopyToTable):
def requires(self):
return ReShape()
host = ""
database = ""
user = ""
password = "" # ;)
table = "extropy"
columns = [("author", "TEXT"),
("file_id", "TEXT"),
("year.month_x", "DATE"),
("subject", "TEXT"),
("subject", "TEXT"),
("file_timestamp", "TEXT"),
("mail_content", "TEXT"),
("next_message", "TEXT"),
("prev_message", "TEXT"),
("year.month_y", "DATE"),]
在此先感謝!
想*(第5行 - 第一塊代碼) – marz