Added default port behaviour for Redshift#2474
Merged
dlstadther merged 3 commits intospotify:masterfrom Jul 26, 2018
Merged
Conversation
added 3 commits
July 25, 2018 09:47
…ch subclass PostgresTarget (e.g. RedshiftTarget) can define their own default port
…ch subclass PostgresTarget (e.g. RedshiftTarget) can define their own default port
Collaborator
|
Thanks @gregroberts ! |
thisiscab
pushed a commit
to glossier/luigi
that referenced
this pull request
Aug 3, 2018
* PostgresTarget default port defined as class variable, so Targets which subclass PostgresTarget (e.g. RedshiftTarget) can define their own default port
thisiscab
pushed a commit
to glossier/luigi
that referenced
this pull request
Aug 8, 2018
* PostgresTarget default port defined as class variable, so Targets which subclass PostgresTarget (e.g. RedshiftTarget) can define their own default port
dlstadther
added a commit
to dlstadther/luigi
that referenced
this pull request
Aug 14, 2018
* upstream-master: (82 commits) S3 client refactor (spotify#2482) Rename to rpc_log_retries, and make it apply to all the logging involved Factor log_exceptions into a configuration parameter Fix attribute forwarding for tasks with dynamic dependencies (spotify#2478) Add a visiblity level for luigi.Parameters (spotify#2278) Add support for multiple requires and inherits arguments (spotify#2475) Add metadata columns to the RDBMS contrib (spotify#2440) Fix race condition in luigi.lock.acquire_for (spotify#2357) (spotify#2477) tests: Use RunOnceTask where possible (spotify#2476) Optional TOML configs support (spotify#2457) Added default port behaviour for Redshift (spotify#2474) Add codeowners file with default and specific example (spotify#2465) Add Data Revenue to the `blogged` list (spotify#2472) Fix Scheduler.add_task to overwrite accepts_messages attribute. (spotify#2469) Use task_id comparison in Task.__eq__. (spotify#2462) Add stale config Move github templates to .github dir Fix transfer config import (spotify#2458) Additions to provide support for the Load Sharing Facility (LSF) job scheduler (spotify#2373) Version 2.7.6 ...
dlstadther
added a commit
to dlstadther/luigi
that referenced
this pull request
Aug 14, 2018
* upstream-master: S3 client refactor (spotify#2482) Rename to rpc_log_retries, and make it apply to all the logging involved Factor log_exceptions into a configuration parameter Fix attribute forwarding for tasks with dynamic dependencies (spotify#2478) Add a visiblity level for luigi.Parameters (spotify#2278) Add support for multiple requires and inherits arguments (spotify#2475) Add metadata columns to the RDBMS contrib (spotify#2440) Fix race condition in luigi.lock.acquire_for (spotify#2357) (spotify#2477) tests: Use RunOnceTask where possible (spotify#2476) Optional TOML configs support (spotify#2457) Added default port behaviour for Redshift (spotify#2474) Add codeowners file with default and specific example (spotify#2465) Add Data Revenue to the `blogged` list (spotify#2472)
dlstadther
added a commit
to dlstadther/luigi
that referenced
this pull request
Aug 16, 2018
* upstream-master: Remove long-deprecated scheduler config variable alternatives (spotify#2491) Bump tornado milestone version (spotify#2490) Update moto to 1.x milestone version (spotify#2471) Use passed password when create a redis connection (spotify#2489) S3 client refactor (spotify#2482) Rename to rpc_log_retries, and make it apply to all the logging involved Factor log_exceptions into a configuration parameter Fix attribute forwarding for tasks with dynamic dependencies (spotify#2478) Add a visiblity level for luigi.Parameters (spotify#2278) Add support for multiple requires and inherits arguments (spotify#2475) Add metadata columns to the RDBMS contrib (spotify#2440) Fix race condition in luigi.lock.acquire_for (spotify#2357) (spotify#2477) tests: Use RunOnceTask where possible (spotify#2476) Optional TOML configs support (spotify#2457) Added default port behaviour for Redshift (spotify#2474) Add codeowners file with default and specific example (spotify#2465) Add Data Revenue to the `blogged` list (spotify#2472) Fix Scheduler.add_task to overwrite accepts_messages attribute. (spotify#2469) Use task_id comparison in Task.__eq__. (spotify#2462)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
RedshiftTarget is a subclass of PostgresTarget, for obvious reasons.
In PostgresTarget, if we do not provide a port, we fallback to 5432, the default Postgres port.
In RedshiftTarget, if we do not provide a port, we still fallback to 5432, even though the default Redshift port is 5439.
This PR fixes this by defining the default port as a static class variable on PostgresTarget, as opposed to a default argument on init. This allows RedshiftTarget to override this default, without changing any other behaviour.
Motivation and Context
From #2473
I only noticed this behaviour when I started using Redshift. I had been supplying the port in PostgresQuery Tasks, even though this never actually got passed to PostgresTarget! So, when I switched to doing the same with Redshift, nothing worked, because RedshiftTarget wasn't being supplied the port by RedshiftQuery, so RedshiftTarget was defaulting to 5432.
Have you tested this? If so, how?
I looked 'very hard' at any code which is affected by the change, and can't see any reason it would fail.