-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add adapter telemetry method for core model run snowplow event. #328
base: main
Are you sure you want to change the base?
Changes from all commits
793db57
31a772e
9fcc789
ebc66b7
755f446
298e9d8
112cbf3
b7cd418
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Under the Hood | ||
body: Add adapter telemetry. | ||
time: 2024-10-16T03:31:59.334011-07:00 | ||
custom: | ||
Author: versusfacit | ||
Issue: "301" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,5 @@ | |
BaseRelation, | ||
RelationType, | ||
SchemaSearchMap, | ||
AdapterTrackingRelationInfo, | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -542,3 +542,11 @@ def flatten(self, allow_multiple_databases: bool = False) -> "SchemaSearchMap": | |
) | ||
|
||
return new | ||
|
||
|
||
@dataclass(frozen=True, eq=False, repr=False) | ||
class AdapterTrackingRelationInfo(FakeAPIObject, Hashable): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an interesting case to me: should this actually be considered a "contract" like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So just putting this forward -- I originally had it as a contract. Then it ran into "can't instantiate protocol" errors. So I'm not sure it should be a contract on that alone! To me, I had it as something related to the object it's related to because I think in terms of object traits a lot :) |
||
adapter_name: str | ||
base_adapter_version: str | ||
adapter_version: str | ||
adapter_details: Any |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import dbt.adapters.__about__ | ||
|
||
from dbt.adapters.base.impl import BaseAdapter | ||
from dbt.adapters.base.relation import AdapterTrackingRelationInfo | ||
|
||
|
||
def test_telemetry_returns(): | ||
res = BaseAdapter.get_adapter_run_info({}) | ||
|
||
assert res.adapter_name == "base" | ||
assert res.base_adapter_version == dbt.adapters.__about__.version | ||
assert res.adapter_version == "" | ||
assert res.adapter_details == {} | ||
|
||
assert type(res) is AdapterTrackingRelationInfo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RelationConfig
doesn't feel like the correct type. I would have guessed this is some version ofNodeConfig
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a good handle on the differences here. When I did introspection, we are passing in a
RelationConfig
. I bet I'm missing some appreciation of all these different Config objects and perhaps I was "lead on" by the suggestion forRelationConfig
in the original ticket. If you feel strongly on this type, please do offer your thoughts here! I'm actively learning here.