-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
🎉 New source: airbyte-native twilio connector #4070
Conversation
airbyte-integrations/connectors/source-twilio/acceptance-test-config.yml
Outdated
Show resolved
Hide resolved
airbyte-integrations/connectors/source-twilio/integration_tests/configured_catalog.json
Outdated
Show resolved
Hide resolved
airbyte-integrations/connectors/source-twilio/integration_tests/invalid_config.json
Outdated
Show resolved
Hide resolved
...tegrations/connectors/source-twilio/source_twilio/schemas/available_phone_numbers_local.json
Outdated
Show resolved
Hide resolved
...tegrations/connectors/source-twilio/source_twilio/schemas/available_phone_numbers_local.json
Outdated
Show resolved
Hide resolved
airbyte-integrations/connectors/source-twilio/source_twilio/streams.py
Outdated
Show resolved
Hide resolved
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.
Look very good, just a few comments.
@htrueman And one more clarification, I did not check everything, but it looks like you just copied the schemas from Singer Tap. Are you sure Singer hasn't altered the data received from the API in any way? Because I did not see any transformations from you, and you left Singer's schemes. |
@htrueman please, run tests) |
airbyte-integrations/connectors/source-twilio/source_twilio/source.py
Outdated
Show resolved
Hide resolved
Update streams which should not be incremental. Fix configs.
…tive-twilio-connector
Fix configs.
/test connector=connectors/source-twilio
|
Some important notes:
|
@davinchia @tuliren would either of you be able to take a look? |
Happy to pick it up, but won't get to this until tmrw. |
airbyte-integrations/connectors/source-twilio/integration_tests/acceptance.py
Outdated
Show resolved
Hide resolved
airbyte-integrations/connectors/source-twilio/source_twilio/streams.py
Outdated
Show resolved
Hide resolved
airbyte-integrations/connectors/source-twilio/source_twilio/streams.py
Outdated
Show resolved
Hide resolved
airbyte-integrations/connectors/source-twilio/source_twilio/streams.py
Outdated
Show resolved
Hide resolved
"""https://www.twilio.com/docs/voice/api/call-resource#create-a-call-resource""" | ||
|
||
parent_stream = Accounts | ||
incremental_filter_field = "EndTime>" |
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.
why is there a >
at the end of this? is this part of Twilio's API?
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.
confused since I see a mixture of incremental_filter_fields
with >
and without.
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.
Agree that is confusing, but it is the only way Twilio filtering works. For instance, https://www.twilio.com/docs/usage/api/usage-record#read-multiple-usagerecord-resources support only filters like StartDate=YYYY-MM-DD
, but the https://www.twilio.com/docs/voice/api/call-resource#create-a-call-resource like StartTime>YYYY-MM-DD
(or StartTime<YYYY-MM-DD
, which is not needed for our purposes).
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.
Got it, thanks for the explanation. Can you also leave a comment the first time this appears? Something like `This is how Twilio filtering works. See for more info.'
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.
@htrueman nice work! appreciate how detail oriented you are and the extra tests you added.
I have some minor question and comments before I approve this.
Can you also go through the pre-merge checklist? Particularly the documentation section, we need to make sure all the right documetation is updated. This can be done in this PR or a follow up PR. My preference is with this PR.
conferences stream is iterable, but cursor field is date-time field in record and filter param is date field. This causes that, for instance, cursor value is saved as 2020-01-01T10:10:10Z, but during filtering it's reduced to date 2020-01-01, and we'll receive records between 2020-01-01T00:00:00Z and 2020-01-02T00:00:00Z, thus tests fail.
What's the update here? I see the tests passing so I assume we figured something out? If we don't we should create a follow up ticket to address this.
We indeed found a solution for that:
UPD: Source docs are also added. Pre-merge Checklist filled. |
Add twilio.md docs. Other PR style fixes.
/test connector=connectors/source-twilio
|
airbyte-integrations/connectors/source-twilio/source_twilio/streams.py
Outdated
Show resolved
Hide resolved
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.
1 minor comment. Feel free to merge after addressing it. Please also make sure the tests are properly passing before doing so. Nice!
…tive-twilio-connector
/test connector=connectors/source-twilio
|
/test connector=connectors/source-twilio
|
What
Closes #3697
How
Recommended reading order
source_twilio/schemas/
andintegration_tests/
source_twilio
python modules.Some important notes:
I could not fill
dependent_phone_numbers
stream.conference_participants
has records only if there are active conference participants (participants, which on conference call at the moment request is made).Some streams have values which changes on each read, so I created a separate catalog for full refresh tests (
constant_records_catalog.json
).conferences
stream is iterable, but cursor field isdate-time
field in record and filter param isdate
field. This causes that, for instance, cursor value is saved as2020-01-01T10:10:10Z
, but during filtering it's reduced to date2020-01-01
, and we'll receive records between2020-01-01T00:00:00Z
and2020-01-02T00:00:00Z
, thus tests fail.It may be fixed if we update
parse_value
injson_schema_helper.py
to supportdate
type similar todate-time
.So another catalog
no_empty_streams_no_conferences_catalog.json
created for incremental tests.Tap source has incremental support for a bunch more streams, but that is just client side filtering after full read, so I cut it out.
Pre-merge Checklist
airbyte_secret
in output spec./gradlew :airbyte-integrations:connectors:<name>:integrationTest
./test connector=connectors/<name>
command as documented here is passing.docs/integrations/
directory./publish
command described here