Skip to content

Commit

Permalink
Merge branches 'upstream/regex' and 'upstream/regex' of github.com:gr…
Browse files Browse the repository at this point in the history
…eat-expectations/great_expectations into upstream/regex
  • Loading branch information
jcampbell committed May 31, 2019
2 parents 83a5a07 + e54e5fa commit c8dc221
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 1 addition & 2 deletions great_expectations/dataset/sqlalchemy_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ def __init__(self, table_name=None, engine=None, connection_string=None,

if engine is not None:
self.engine = engine

else:
try:
self.engine = sa.create_engine(connection_string)
Expand All @@ -204,7 +203,7 @@ def __init__(self, table_name=None, engine=None, connection_string=None,


try:
insp = reflection.Inspector.from_engine(engine)
insp = reflection.Inspector.from_engine(self.engine)
self.columns = insp.get_columns(table_name, schema=schema)
except KeyError:
# we will get a KeyError for temporary tables, since
Expand Down
4 changes: 4 additions & 0 deletions tests/sqlalchemy_dataset/test_sqlalchemydataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ def test_missing_engine_error():
assert "Engine or connection_string must be provided." in str(err)


def test_only_connection_string():
SqlAlchemyDataset('test_engine', connection_string='sqlite://')


def test_schema_custom_sql_error():
engine = sa.create_engine('sqlite://')

Expand Down

0 comments on commit c8dc221

Please sign in to comment.