Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit a6c25b1

Browse files
authored
Merge branch 'master' into remove-duckdb-version-constrain
2 parents 4c67744 + 101a488 commit a6c25b1

File tree

7 files changed

+34
-11
lines changed

7 files changed

+34
-11
lines changed

data_diff/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ def _get_log_handlers(is_dbt: Optional[bool] = False) -> Dict[str, logging.Handl
4848
rich_handler.setLevel(logging.WARN)
4949
handlers["rich_handler"] = rich_handler
5050

51-
# only use log_status_handler in a terminal
52-
if rich_handler.console.is_terminal and is_dbt:
51+
# only use log_status_handler in an interactive terminal session
52+
if rich_handler.console.is_interactive and is_dbt:
5353
log_status_handler = LogStatusHandler()
5454
log_status_handler.setFormatter(logging.Formatter(log_format_status, datefmt=date_format))
5555
log_status_handler.setLevel(logging.DEBUG)

data_diff/dbt.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from .format import jsonify, jsonify_error
2424
from .tracking import (
2525
bool_ask_for_email,
26+
bool_notify_about_extension,
2627
create_email_signup_event_json,
2728
set_entrypoint_name,
2829
set_dbt_user_id,
@@ -48,6 +49,7 @@
4849

4950
logger = getLogger(__name__)
5051
CLOUD_DOC_URL = "https://docs.datafold.com/development_testing/cloud"
52+
EXTENSION_INSTALL_URL = "https://get.datafold.com/datafold-vs-code-install"
5153

5254

5355
class TDiffVars(pydantic.BaseModel):
@@ -155,6 +157,8 @@ def dbt_diff(
155157
for thread in diff_threads:
156158
thread.join()
157159

160+
_extension_notification()
161+
158162

159163
def _get_diff_vars(
160164
dbt_parser: "DbtParser",
@@ -517,3 +521,10 @@ def _email_signup() -> None:
517521
if email:
518522
event_json = create_email_signup_event_json(email)
519523
run_as_daemon(send_event_json, event_json)
524+
525+
526+
def _extension_notification() -> None:
527+
if bool_notify_about_extension():
528+
rich.print(
529+
f"\n\nHaving a good time diffing? :heart_eyes-emoji:\nMake sure to check out the free [bold]Datafold VS Code extension[/bold] for more a more seamless diff experience:\n{EXTENSION_INSTALL_URL}"
530+
)

data_diff/dbt_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def try_set_dbt_flags():
6262
PROJECT_FILE = "dbt_project.yml"
6363
PROFILES_FILE = "profiles.yml"
6464
LOWER_DBT_V = "1.0.0"
65-
UPPER_DBT_V = "1.6.0"
65+
UPPER_DBT_V = "1.7.0"
6666

6767

6868
# https://github.com/dbt-labs/dbt-core/blob/c952d44ec5c2506995fbad75320acbae49125d3d/core/dbt/cli/resolvers.py#L6

data_diff/tracking.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import urllib.request
1212
from uuid import uuid4
1313
import toml
14+
from rich import get_console
1415

1516
from .version import __version__
1617

@@ -61,6 +62,17 @@ def bool_ask_for_email() -> bool:
6162
return False
6263

6364

65+
def bool_notify_about_extension() -> bool:
66+
profile = _load_profile()
67+
console = get_console()
68+
if "notified_about_extension" not in profile and console.is_interactive:
69+
profile["notified_about_extension"] = ""
70+
with open(DEFAULT_PROFILE, "w") as conf:
71+
toml.dump(profile, conf)
72+
return True
73+
return False
74+
75+
6476
g_tracking_enabled = True
6577
g_anonymous_id = None
6678

data_diff/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.8.0"
1+
__version__ = "0.8.1"

poetry.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "data-diff"
3-
version = "0.8.0"
3+
version = "0.8.1"
44
description = "Command-line tool and Python library to efficiently diff rows across two different databases."
55
authors = ["Datafold <data-diff@datafold.com>"]
66
license = "MIT"
@@ -37,7 +37,7 @@ trino = {version="^0.314.0", optional=true}
3737
presto-python-client = {version="*", optional=true}
3838
clickhouse-driver = {version="*", optional=true}
3939
duckdb = {version="*", optional=true}
40-
dbt-artifacts-parser = {version="^0.3.0"}
40+
dbt-artifacts-parser = {version="^0.4.0"}
4141
dbt-core = {version="^1.0.0"}
4242
keyring = "*"
4343
tabulate = "^0.9.0"
@@ -59,7 +59,7 @@ presto-python-client = "*"
5959
clickhouse-driver = "*"
6060
vertica-python = "*"
6161
duckdb = "^0.7.0"
62-
dbt-artifacts-parser = "^0.3.0"
62+
dbt-artifacts-parser = "^0.4.0"
6363
dbt-core = "^1.0.0"
6464
# google-cloud-bigquery = "*"
6565
# databricks-sql-connector = "*"

0 commit comments

Comments
 (0)