Skip to content

Commit

Permalink
fix: ensure 'concurrency' is not null when using it
Browse files Browse the repository at this point in the history
  • Loading branch information
cdkini committed Jan 4, 2022
1 parent a4352f3 commit 7e6be55
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
12 changes: 7 additions & 5 deletions great_expectations/datasource/sqlalchemy_datasource.py
Expand Up @@ -244,11 +244,13 @@ def __init__(
self.engine = kwargs.pop("engine")

else:
concurrency = (
data_context.concurrency
if data_context is not None
else ConcurrencyConfig()
)

concurrency: ConcurrencyConfig
if data_context is None or data_context.concurrency is not None:
concurrency = ConcurrencyConfig()
else:
concurrency = data_context.concurrency

concurrency.add_sqlalchemy_create_engine_parameters(kwargs)

# If a connection string or url was provided, use that.
Expand Down
Expand Up @@ -236,9 +236,11 @@ def __init__(
)
self.engine = engine
else:
concurrency = (
concurrency if concurrency is not None else ConcurrencyConfig()
)
concurrency: ConcurrencyConfig
if data_context is None or data_context.concurrency is not None:
concurrency = ConcurrencyConfig()
else:
concurrency = data_context.concurrency
concurrency.add_sqlalchemy_create_engine_parameters(kwargs)

if credentials is not None:
Expand Down

0 comments on commit 7e6be55

Please sign in to comment.