-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
🐍 Source Mixpanel: certification preparations #30149
🐍 Source Mixpanel: certification preparations #30149
Conversation
Before Merging a Connector Pull RequestWow! What a great pull request you have here! 🎉 To merge this PR, ensure the following has been done/considered for each connector added or updated:
If the checklist is complete, but the CI check is failing,
|
|
Step | Result |
---|---|
Connector package install | ✅ |
Build source-mixpanel docker image for platform linux/x86_64 | ✅ |
Unit tests | ✅ |
Acceptance tests | ❌ |
Code format checks | ✅ |
Validate airbyte-integrations/connectors/source-mixpanel/metadata.yaml | ❌ |
Connector version semver check | ✅ |
Connector version increment check | ✅ |
QA checks | ✅ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-mixpanel test
|
Step | Result |
---|---|
Connector package install | ✅ |
Build source-hubplanner docker image for platform linux/x86_64 | ✅ |
Acceptance tests | ❌ |
Code format checks | ✅ |
Validate airbyte-integrations/connectors/source-hubplanner/metadata.yaml | ✅ |
Connector version semver check | ✅ |
Connector version increment check | ❌ |
QA checks | ✅ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-hubplanner test
|
Step | Result |
---|---|
Connector package install | ✅ |
Build source-mixpanel docker image for platform linux/x86_64 | ✅ |
Unit tests | ✅ |
Acceptance tests | ❌ |
Code format checks | ✅ |
Validate airbyte-integrations/connectors/source-mixpanel/metadata.yaml | ❌ |
Connector version semver check | ✅ |
Connector version increment check | ✅ |
QA checks | ✅ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-mixpanel test
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.
In general, this looks really good! Solid UX improvements. The only blocking comment I have at the moment is around swallowing the config errors, since they won't get raised. I did leave some other suggestions as well, though.
- config_path: "secrets/config_old.json" | ||
status: "succeed" |
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.
Let's remember to delete this afterwards if its not going to be used anymore. It makes sense that this old config won't be valid anymore.
dockerImageTag: 0.1.38 | ||
dockerImageTag: 1.0.0 |
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.
You're going to need a releases: breakingChanges:
entry for this change - the validation should also tell you that, though
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.
Added
raise_config_error("Please provide a valid True/False value for the `Select properties by default` parameter.") | ||
|
||
if not isinstance(attribution_window, int) or attribution_window < 0: | ||
raise_config_error("Please provide a valid integer for the `Attribution window` parameter.") | ||
if not isinstance(date_window_size, int) or date_window_size < 1: | ||
raise_config_error("Please provide a valid integer for the `Date slicing window` parameter.") |
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.
So many specific config errors - this is great!
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.
Could be be specific on what is valid? Looks like for attribution window, valid is positive or 0, and for date slicing window, it must be positive
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.
Added comments to spec
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.
that works too. UX-wise someone might have an opinion on where it should go as to not be cluttered, but I think as long as the info is somewhere, its good for now
except Exception as e: | ||
return False, e | ||
return False, e.message |
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.
Unfortunately doing this here negates all the good work of our config errors! Instead we should remove the exception wrapping here.
Then when we hit a config error, it will be raised and shown to the user (instead of only sending a connection status failed message, which would not contain the traceback).
If we hit an error in the above methods that we don't have handling for, the CDK's check()
method which wraps this method will do the proper error handling of emitting an AirbyteTraceMessage (of a "system" error instead of a "config" error)
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.
Fixed
@@ -84,7 +114,7 @@ def check_connection(self, logger: AirbyteLogger, config: Mapping[str, Any]) -> | |||
config = self._validate_and_transform(config) | |||
auth = self.get_authenticator(config) | |||
except Exception as e: | |||
return False, e | |||
return False, e.message | |||
|
|||
# https://github.com/airbytehq/airbyte/pull/27252#discussion_r1228356872 | |||
# temporary solution, testing access for all streams to avoid 402 error |
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.
The below testing only checks one stream before early returning - I don't think it will actually check all streams. This might be worth looking at, in addition to the exception/error handling down here
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.
This is workaround for this issue: #27252 (comment)
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.
Right, but the comment says it is testing access for all streams, but it is only testing access for one stream?
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.
Notably, it used to break
if successfully connected to one stream, but now returns True:
That doesn't look like it was introduced in this PR, so I won't be a stickler about it, but a follow up issue would be good
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.
The snippet from your comment behaves similarly but breaks instead of returning. The comment indicates that the system tests to see if any stream functions correctly. If at least one does, the check is deemed successful. I'll rephrase it for better clarity.
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.
Ah, if thats the case, then yes I've misinterpreted the comment - thanks
I guess I was thinking continue
(onto the next one), not break
@@ -60,14 +61,14 @@ | |||
"project_id": { | |||
"order": 1, | |||
"title": "Project ID", | |||
"description": "Your project ID number. See the <a href=\"https://help.mixpanel.com/hc/en-us/articles/115004490503-Project-Settings#project-id\">docs</a> for more information on how to obtain this.", | |||
"description": "Your project ID number. See the <a href=\"https://help.mixpanel.com/hc/en-us/articles/115004490503-Project-Settings#project-id\">docs</a> for more information on how to obtain this. Required if you are using a service account to authenticate.", |
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.
Is there a way to leverage group
s to make this conditionally required? (General question, I don't know the answer to this. But if there is, I'd recommend we do it). Someone from @airbytehq/connector-extensibility might be able to answer this
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.
Changed parameter to required
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.
Ah that looks like it will do it, I think - thanks! in that case we can probably remove the Required if you are using a service account to authenticate.
# we assume there's at least 10 records per request returned in average. Given that each request is followed by a 60 seconds | ||
# sleep, we'll have to emit state once per 150 records |
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.
If each request is followed by a 60 second sleep anyway, perhaps we could emit state after every request? The 15 minutes is a maximum, and it seems like it won't slow down the connector, since the bottleneck is the API rate-limiting us
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.
Decreased checkpoint interval to emit state every request
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.
hm it looks like it still says we're emitting it every 15 records?
airbyte-integrations/connectors/source-mixpanel/source_mixpanel/streams/base.py
Show resolved
Hide resolved
|
Step | Result |
---|---|
Connector package install | ✅ |
Build source-hubplanner docker image for platform linux/x86_64 | ✅ |
Acceptance tests | ❌ |
Code format checks | ✅ |
Validate airbyte-integrations/connectors/source-hubplanner/metadata.yaml | ✅ |
Connector version semver check | ✅ |
Connector version increment check | ❌ |
QA checks | ✅ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-hubplanner test
|
Step | Result |
---|---|
Connector package install | ✅ |
Build source-mixpanel docker image for platform linux/x86_64 | ✅ |
Unit tests | ✅ |
Acceptance tests | ❌ |
Code format checks | ✅ |
Validate airbyte-integrations/connectors/source-mixpanel/metadata.yaml | ❌ |
Connector version semver check | ✅ |
Connector version increment check | ✅ |
QA checks | ✅ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-mixpanel test
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
1c34027
to
603d9c7
Compare
|
Step | Result |
---|---|
Connector package install | ✅ |
Build source-mixpanel docker image for platform linux/x86_64 | ✅ |
Unit tests | ❌ |
Code format checks | ✅ |
Validate airbyte-integrations/connectors/source-mixpanel/metadata.yaml | ✅ |
Connector version semver check | ✅ |
Connector version increment check | ✅ |
QA checks | ❌ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-mixpanel test
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.
Here's what I reviewed:
- breaking change metadata
- new config errors
No more blocking changes from me
releases: | ||
breakingChanges: | ||
1.0.0: | ||
message: In this release, the "datetime" column in the "engage" stream will transition from Date/Time/Datetime types to string due to Mixpanel inconsistencies. Additionally, the "credentials" field is now mandatory, and the "project_id" path has been updated, though a config migration will minimize disruptions. |
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.
Nice message. Should the user reset the engage stream as a result of the type change? Maybe we're doing it for them?
I think you'll need a migrations file - QA checks should let you know this
raise_config_error("Please provide a valid True/False value for the `Select properties by default` parameter.") | ||
|
||
if not isinstance(attribution_window, int) or attribution_window < 0: | ||
raise_config_error("Please provide a valid integer for the `Attribution window` parameter.") | ||
if not isinstance(date_window_size, int) or date_window_size < 1: | ||
raise_config_error("Please provide a valid integer for the `Date slicing window` parameter.") |
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.
that works too. UX-wise someone might have an opinion on where it should go as to not be cluttered, but I think as long as the info is somewhere, its good for now
airbyte-integrations/connectors/source-mixpanel/source_mixpanel/streams/base.py
Show resolved
Hide resolved
# we assume there's at least 10 records per request returned in average. Given that each request is followed by a 60 seconds | ||
# sleep, we'll have to emit state once per 150 records |
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.
hm it looks like it still says we're emitting it every 15 records?
@@ -60,14 +61,14 @@ | |||
"project_id": { | |||
"order": 1, | |||
"title": "Project ID", | |||
"description": "Your project ID number. See the <a href=\"https://help.mixpanel.com/hc/en-us/articles/115004490503-Project-Settings#project-id\">docs</a> for more information on how to obtain this.", | |||
"description": "Your project ID number. See the <a href=\"https://help.mixpanel.com/hc/en-us/articles/115004490503-Project-Settings#project-id\">docs</a> for more information on how to obtain this. Required if you are using a service account to authenticate.", |
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.
Ah that looks like it will do it, I think - thanks! in that case we can probably remove the Required if you are using a service account to authenticate.
@@ -51,7 +51,8 @@ Syncing huge date windows may take longer due to Mixpanel's low API rate-limits | |||
|
|||
| Version | Date | Pull Request | Subject | | |||
|:--------|:-----------|:---------------------------------------------------------|:------------------------------------------------------------------------------------------------------------| | |||
| 0.1.39 | 2023-09-15 | [30469](https://github.com/airbytehq/airbyte/pull/30469) | Add default primary key `distinct_id` to `Export` stream | | |||
| 1.0.0 | 2023-09-20 | [30149](https://github.com/airbytehq/airbyte/pull/30149) | Prepare for certifying to the next stage | |
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.
Can we describe what changed in the actual code instead of referring to certification?
@@ -84,7 +114,7 @@ def check_connection(self, logger: AirbyteLogger, config: Mapping[str, Any]) -> | |||
config = self._validate_and_transform(config) | |||
auth = self.get_authenticator(config) | |||
except Exception as e: | |||
return False, e | |||
return False, e.message | |||
|
|||
# https://github.com/airbytehq/airbyte/pull/27252#discussion_r1228356872 | |||
# temporary solution, testing access for all streams to avoid 402 error |
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.
Right, but the comment says it is testing access for all streams, but it is only testing access for one stream?
@@ -84,7 +114,7 @@ def check_connection(self, logger: AirbyteLogger, config: Mapping[str, Any]) -> | |||
config = self._validate_and_transform(config) | |||
auth = self.get_authenticator(config) | |||
except Exception as e: | |||
return False, e | |||
return False, e.message | |||
|
|||
# https://github.com/airbytehq/airbyte/pull/27252#discussion_r1228356872 | |||
# temporary solution, testing access for all streams to avoid 402 error |
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.
Notably, it used to break
if successfully connected to one stream, but now returns True:
That doesn't look like it was introduced in this PR, so I won't be a stickler about it, but a follow up issue would be good
❓ Question: Is it feasible for us to separate out non-breaking and breaking changes and merge the non-breaking ones first? In general, these certification PRs are huge. I would love to see them implemented in a more incremental way, so that if there are any issues with any part of the PR, we can roll back as necessary without undoing everything. As a bonus we can check each thing off as it's done, and ship more values to users earlier. cc @katmarkham |
|
Step | Result |
---|---|
Connector package install | ✅ |
Build source-mixpanel docker image for platform linux/x86_64 | ✅ |
Unit tests | ✅ |
Acceptance tests | ❌ |
Code format checks | ✅ |
Validate airbyte-integrations/connectors/source-mixpanel/metadata.yaml | ✅ |
Connector version semver check | ✅ |
Connector version increment check | ✅ |
QA checks | ❌ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-mixpanel test
00a22be
to
3dcd3a7
Compare
|
Step | Result |
---|---|
Connector package install | ✅ |
Build source-mixpanel docker image for platform linux/x86_64 | ✅ |
Unit tests | ✅ |
Acceptance tests | ❌ |
Code format checks | ✅ |
Validate airbyte-integrations/connectors/source-mixpanel/metadata.yaml | ✅ |
Connector version semver check | ✅ |
Connector version increment check | ✅ |
QA checks | ✅ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-mixpanel test
5ca55e4
to
8de0b88
Compare
|
Step | Result |
---|---|
Connector package install | ✅ |
Build source-mixpanel docker image for platform linux/x86_64 | ✅ |
Unit tests | ✅ |
Acceptance tests | ✅ |
Code format checks | ✅ |
Validate airbyte-integrations/connectors/source-mixpanel/metadata.yaml | ✅ |
Connector version semver check | ✅ |
Connector version increment check | ✅ |
QA checks | ✅ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-mixpanel test
@@ -75,7 +75,7 @@ class Export(DateSlicesMixin, IncrementalMixpanelStream): | |||
3 queries per second and 60 queries per hour. | |||
""" | |||
|
|||
primary_key: str = "distinct_id" | |||
primary_key: Iterable[str] = ["distinct_id", "event", "time"] |
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.
This is a breaking change I believe
ISO_FORMAT_PATTERN = re.compile(r"^(\d{4}-\d{2}-\d{2})[ t](\d{2}:\d{2}:\d{2})$") | ||
|
||
|
||
def to_iso_format(s: str) -> str: |
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.
Let's add some unit tests please for fix_date_time
and to_iso_format
0550d05
to
87e2a6e
Compare
|
Step | Result |
---|---|
Connector package install | ✅ |
Build source-mixpanel docker image for platform linux/x86_64 | ✅ |
Unit tests | ✅ |
Acceptance tests | ✅ |
Code format checks | ✅ |
Validate airbyte-integrations/connectors/source-mixpanel/metadata.yaml | ✅ |
Connector version semver check | ✅ |
Connector version increment check | ✅ |
QA checks | ✅ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-mixpanel test
What
#29746
How
credentials
required🚨 User Impact 🚨
No breaking changes. Config schema was changed, but config migrations will handle it.