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

[CT-2078] Logging issues since feature branch merge #6933

Closed
Tracked by #6706
jtcohen6 opened this issue Feb 10, 2023 · 1 comment · Fixed by #6940
Closed
Tracked by #6706

[CT-2078] Logging issues since feature branch merge #6933

jtcohen6 opened this issue Feb 10, 2023 · 1 comment · Fixed by #6940
Assignees
Labels

Comments

@jtcohen6
Copy link
Contributor

jtcohen6 commented Feb 10, 2023

Since the merge of feature/click-cli to main, 🎩 noticed a couple things with logging:

  • Missing the first few events
  • --log-cache-events not working
  • No more call to MainKeyboardInterrupt on ^C. We just use click's built-in handling for this (Aborted!). It returns an exit code of 1, where it previously returned 130
  • ... probably more things ...

Previous

$ dbt --debug run --log-cache-events


============================== 2023-02-10 12:21:23.216578 | 1f99c4cf-3cef-4685-a4ef-b7c3ee9c7b56 ==============================
12:21:23.216578 [info ] [MainThread]: Running with dbt=1.4.1
12:21:23.218780 [debug] [MainThread]: running dbt with arguments {'debug': True, 'write_json': True, 'use_colors': True, 'printer_width': 80, 'version_check': True, 'partial_parse': True, 'static_parser': True, 'profiles_dir': '/Users/jerco/.dbt', 'send_anonymous_usage_stats': True, 'quiet': False, 'no_print': False, 'cache_selected_only': False, 'log_cache_events': True, 'which': 'run', 'rpc_method': 'run', 'indirect_selection': 'eager'}
...
12:21:24.165778 [debug] [MainThread]: before adding : {}
12:21:24.166682 [debug] [MainThread]: adding relation: ReferenceKeyMsg(database='jerco', schema='dbt_jcohen', identifier='customers')

Current

$ dbt --log-cache-events --debug run
12:23:18.712880 [debug] [MainThread]: checksum: 79210592253dc188120a6b0a7d88c278c3f9ff6d304e580fbf29e1011c5cfd1e, vars: {}, profile: None, target: None, version: 1.5.0a1
12:23:18.722508 [info ] [MainThread]: Unable to do partial parsing because of a version mismatch
...
<no cache events>
...
@github-actions github-actions bot changed the title Logging issues since feature branch merge [CT-2078] Logging issues since feature branch merge Feb 10, 2023
@jtcohen6
Copy link
Contributor Author

Looks like we removed these event calls, and haven't replaced them in the new initialization flow:

dbt-core/core/dbt/main.py

Lines 244 to 248 in 4d0ee2f

fire_event(MainReportVersion(version=str(dbt.version.installed), log_version=LOG_VERSION))
fire_event(MainReportArgs(args=args_to_dict(parsed)))
if dbt.tracking.active_user is not None: # mypy appeasement, always true
fire_event(MainTrackingUserState(user_state=dbt.tracking.active_user.state()))

That should be a simple-enough fix. The cache-level logging might take a little more digging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant