Skip to content
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

Add ssl prefer to remaining redshift areas, increase timeout (maybe) #4981

Merged
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ The types of changes are:
- Fixed and optimized Database Icon SVGs used in Datamap [#4969](https://github.com/ethyca/fides/pull/4969)
- Fixed "add" icons on some buttons being wrong size [#4975](https://github.com/ethyca/fides/pull/4975)
- Masked "Keyfile credentials" input on integration config form [#4971](https://github.com/ethyca/fides/pull/4971)
- Handles further ssl needs for Generating Datasets from Redshift [#4981](https://github.com/ethyca/fides/pull/4981)
NevilleS marked this conversation as resolved.
Show resolved Hide resolved
- Fixed ability to update consent preferences after they've previously been set [#4984](https://github.com/ethyca/fides/pull/4984)
- Fixed validations for privacy declaration taxonomy labels when creating/updating a System [#4982](https://github.com/ethyca/fides/pull/4982)
- Allow property-specific messaging to work with non-custom templates [#4986](https://github.com/ethyca/fides/pull/4986)
Expand Down
10 changes: 9 additions & 1 deletion src/fides/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
)
if "redshift" in connection_string:
connect_args["sslmode"] = "prefer"
connect_args["connect_timeout"] = 60

Check warning on line 44 in src/fides/core/utils.py

View check run for this annotation

Codecov / codecov/patch

src/fides/core/utils.py#L44

Added line #L44 was not covered by tests
try:
engine = sqlalchemy.create_engine(connection_string, connect_args=connect_args)
except Exception as err:
Expand All @@ -58,8 +59,15 @@
"""
Use SQLAlchemy to create a DB engine.
"""
# Pymssql doesn't support this arg
connect_args: Dict[str, Any] = (

Check warning on line 63 in src/fides/core/utils.py

View check run for this annotation

Codecov / codecov/patch

src/fides/core/utils.py#L63

Added line #L63 was not covered by tests
{"connect_timeout": 10} if "pymssql" not in connection_string else {}
)
if "redshift" in connection_string:
connect_args["sslmode"] = "prefer"
connect_args["connect_timeout"] = 60

Check warning on line 68 in src/fides/core/utils.py

View check run for this annotation

Codecov / codecov/patch

src/fides/core/utils.py#L67-L68

Added lines #L67 - L68 were not covered by tests
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Redshift datasets from Axios were taking forever to load, this number let it run long enough to respond with all of the dataset information

try:
engine = sqlalchemy.create_engine(connection_string)
engine = sqlalchemy.create_engine(connection_string, connect_args=connect_args)

Check warning on line 70 in src/fides/core/utils.py

View check run for this annotation

Codecov / codecov/patch

src/fides/core/utils.py#L70

Added line #L70 was not covered by tests
with engine.begin() as connection:
connection.execute("SELECT 1")
except SQLAlchemyError as error:
Expand Down