-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Update postgres.py #2615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update postgres.py #2615
Conversation
added port to `PostgresTarget`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - but please update test :)
not sure what failed here |
That top codecov can be ignored. The important part is that Travis passed. |
Hey, just FYI that this seems to have created a breaking change in a patch release. The previous way of defining ports was within the class MyQueryTask(luigi.contrib.postgres.PostgresQuery):
host = ':'.join([db_host, db_port])
database = db_name
user = db_user
password = db_password This now raises an exception like the following: Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/luigi/worker.py", line 401, in check_complete
is_complete = task.complete()
File "/usr/local/lib/python3.6/site-packages/luigi/task.py", line 827, in complete
return all(r.complete() for r in flatten(self.requires()))
File "/usr/local/lib/python3.6/site-packages/luigi/task.py", line 827, in <genexpr>
return all(r.complete() for r in flatten(self.requires()))
File "/usr/local/lib/python3.6/site-packages/luigi/task.py", line 565, in complete
outputs = flatten(self.output())
File "/usr/local/lib/python3.6/site-packages/luigi/contrib/postgres.py", line 396, in output
port=self.port
AttributeError: 'MyQueryTask' object has no attribute 'port' It might be worth making this backwards compatible with the old format. |
@dhuckins is this something you'd like to look into and patch? Thanks for raising @duckontheweb |
sure, added issue #2625 luigi/luigi/contrib/mssqldb.py Lines 59 to 64 in eadf7ab
|
I think this PR is not really needed. I suggest we revert it. |
cc @NatashaL |
Fine by me. Then we close #2627 too |
shouldn't |
They should, so #2627 adds that. |
added port to
PostgresTarget
Description
added port to the postgres.Query
Motivation and Context
was required to use
postgres.Query
to connect to a postgres db that did not use the default portHave you tested this? If so, how?
"I ran my jobs with this code and it works for me."