Skip to content

Commit

Permalink
Merge branch 'develop' into feature/multicolumn
Browse files Browse the repository at this point in the history
  • Loading branch information
abegong committed Feb 12, 2019
2 parents a7c78c2 + d414920 commit 6957198
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion great_expectations/data_context/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ def connect(self, options):
def list_datasets(self):
return NotImplementedError

def get_data_set(self, dataset_name):
def get_dataset(self, dataset_name):
return NotImplementedError
4 changes: 2 additions & 2 deletions great_expectations/data_context/sqlalchemy_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ def list_datasets(self):
tables = [str(table) for table in self.meta.sorted_tables]
return tables

def get_dataset(self, dataset_name, custom_sql=None):
return SqlAlchemyDataset(table_name=dataset_name, engine=self.engine, custom_sql=custom_sql)
def get_dataset(self, dataset_name, custom_sql=None, schema=None):
return SqlAlchemyDataset(table_name=dataset_name, engine=self.engine, custom_sql=custom_sql, schema=schema)
8 changes: 5 additions & 3 deletions tests/test_data_contexts/test_data_contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_db_connection_string(tmpdir_factory):
path = tmpdir_factory.mktemp("db_context").join("test.db")
engine = sa.create_engine('sqlite:///' + str(path))
df1.to_sql('table_1', con=engine, index=True)
df2.to_sql('table_2', con=engine, index=True)
df2.to_sql('table_2', con=engine, index=True, schema='main')

# Return a connection string to this newly-created db
return 'sqlite:///' + str(path)
Expand Down Expand Up @@ -45,8 +45,10 @@ def test_sqlalchemy_data_context(test_db_connection_string):
'SqlAlchemy', test_db_connection_string, echo=False)

assert context.list_datasets() == ['table_1', 'table_2']
dataset = context.get_dataset('table_1')
assert isinstance(dataset, SqlAlchemyDataset)
dataset1 = context.get_dataset('table_1')
dataset2 = context.get_dataset('table_2', schema='main')
assert isinstance(dataset1, SqlAlchemyDataset)
assert isinstance(dataset2, SqlAlchemyDataset)


def test_pandas_data_context(test_folder_connection_path):
Expand Down

0 comments on commit 6957198

Please sign in to comment.