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

Fix issue with conflicting max_ids #549

Merged
merged 5 commits into from
Apr 24, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
CI fix
  • Loading branch information
joshua-oss committed Apr 24, 2023
commit 91a10012bd1128dc7a6c51827dacd4f62779b6dd
22 changes: 12 additions & 10 deletions sql/tests/engines/test_db_count.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,18 @@ def test_db_counts(self, test_databases):
print(f"Table {dbname}.PUMS.{tablename} has {n} COUNT(age) rows in {reader.engine}")
assert(n > lower and n < upper)
def test_with_two_table_meta(self, test_databases):
conn = test_databases.get_connection(database='PUMS_null', engine='postgres')
if conn is not None:
# pandas doesn't support multiple tables per metadata
table_name = conn.table_name
conn = conn.connection
query = f'SELECT COUNT(age) FROM {table_name}'
for meta in [two_table_meta_a, two_table_meta_b]:
reader = from_connection(conn, metadata=meta, privacy=privacy)
count_age = reader.execute(query)[1][0]
assert count_age > 890 and count_age < 1020
for engine in ['postgres', 'sqlserver']:
dbdataset = test_databases.get_connection(database='PUMS_null', engine=engine)
if dbdataset is not None:
# pandas doesn't support multiple tables per metadata
table_name = dbdataset.table_name
conn = dbdataset.connection
if table_name.upper() == 'PUMS.PUMS':
query = f'SELECT COUNT(age) FROM PUMS.PUMS'
for meta in [two_table_meta_a, two_table_meta_b]:
reader = from_connection(conn, metadata=meta, privacy=privacy)
count_age = reader.execute(query)[1][0]
assert count_age > 890 and count_age < 1020
def test_db_counts_star(self, test_databases):
# Actual is 1000
for dbname in ['PUMS', 'PUMS_pid', 'PUMS_large', 'PUMS_dup', 'PUMS_null']:
Expand Down