Skip to content

Commit

Permalink
Releasing 1.7.0-rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
prdpsvs committed May 5, 2024
1 parent edece5d commit f207322
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dbt/adapters/fabricspark/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "1.7.0"
version = "1.7.0rc1"
20 changes: 20 additions & 0 deletions dbt/adapters/fabricspark/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,26 @@ def get_rows_different_sql(
)

return sql

def run_sql_for_tests(self, sql, fetch, conn):
cursor = conn.handle.cursor()
try:
cursor.execute(sql)
if fetch == "one":
if hasattr(cursor, "fetchone"):
return cursor.fetchone()
else:
return cursor.fetchall()[0]
elif fetch == "all":
return cursor.fetchall()
else:
return
except BaseException as e:
print(sql)
print(e)
raise
finally:
conn.transaction_open = False

def standardize_grants_dict(self, grants_table: agate.Table) -> dict:
grants_dict: Dict[str, List[str]] = {}
Expand Down
4 changes: 2 additions & 2 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# install latest changes in dbt-core
# TODO: how to automate switching from develop to version branches?
git+https://github.com/dbt-labs/dbt-core.git@v1.7.4#egg=dbt-core&subdirectory=core
git+https://github.com/dbt-labs/dbt-core.git@v1.7.4#egg=dbt-tests-adapter&subdirectory=tests/adapter
git+https://github.com/dbt-labs/dbt-core.git@v1.7.10#egg=dbt-core&subdirectory=core
git+https://github.com/dbt-labs/dbt-core.git@v1.7.10#egg=dbt-tests-adapter&subdirectory=tests/adapter

# if version 1.x or greater -> pin to major version
# if version 0.x -> pin to minor
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def _get_dbt_core_version():


package_name = "dbt-fabricspark"
package_version = "1.7.0"
package_version = "1.7.0rc1"
dbt_core_version = _get_dbt_core_version()
print(f"printing version --------- {dbt_core_version}")
description = """The Apache Spark adapter plugin for dbt"""
Expand Down
28 changes: 28 additions & 0 deletions tests/functional/adapter/basic/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,37 @@
check_relation_types,
check_relations_equal,
)
from dbt.tests.adapter.basic.files import (
seeds_base_csv,
base_view_sql,
base_table_sql,
base_materialized_var_sql,
schema_base_yml,
)

class BaseSimpleMaterializations:

@pytest.fixture(scope="class")
def models(self):
return {
"view_model.sql": base_view_sql,
"table_model.sql": base_table_sql,
"swappable.sql": base_materialized_var_sql,
"schema.yml": schema_base_yml,
}

@pytest.fixture(scope="class")
def seeds(self):
return {
"base.csv": seeds_base_csv,
}

@pytest.fixture(scope="class")
def project_config_update(self):
return {
"name": "base",
}

@pytest.fixture(scope="class")
def dbt_profile_data(unique_schema, dbt_profile_target, profiles_config_update):
profile = {
Expand Down
6 changes: 3 additions & 3 deletions tests/functional/adapter/basic/test_snapshot_check_cols.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ def seeds(self):
@pytest.fixture(scope="class")
def snapshots(self):
return {
"cc_all_snapshot.sql": cc_all_snapshot_sql.replace("target_database=database","target_database=\"test\"").replace("target_schema=schema","target_schema=\"test\""),
"cc_date_snapshot.sql": cc_date_snapshot_sql.replace("target_database=database","target_database=\"test\"").replace("target_schema=schema","target_schema=\"test\""),
"cc_name_snapshot.sql": cc_name_snapshot_sql.replace("target_database=database","target_database=\"test\"").replace("target_schema=schema","target_schema=\"test\""),
"cc_all_snapshot.sql": cc_all_snapshot_sql.replace("target_database=database","target_database=\"dbttest\"").replace("target_schema=schema","target_schema=\"dbttest\""),
"cc_date_snapshot.sql": cc_date_snapshot_sql.replace("target_database=database","target_database=\"dbttest\"").replace("target_schema=schema","target_schema=\"dbttest\""),
"cc_name_snapshot.sql": cc_name_snapshot_sql.replace("target_database=database","target_database=\"dbttest\"").replace("target_schema=schema","target_schema=\"dbttest\""),
}

@pytest.fixture(scope="class")
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/adapter/basic/test_snapshot_timestamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def seeds(self):
@pytest.fixture(scope="class")
def snapshots(self):
return {
"ts_snapshot.sql": ts_snapshot_sql.replace("target_database=database","target_database=\"test\"").replace("target_schema=schema","target_schema=\"test\""),
"ts_snapshot.sql": ts_snapshot_sql.replace("target_database=database","target_database=\"dbttest\"").replace("target_schema=schema","target_schema=\"dbttest\""),
}

@pytest.fixture(scope="class")
Expand Down

0 comments on commit f207322

Please sign in to comment.