Repository navigation
Source SalesForce: fix encoding guess - #29538
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 |
|---|---|
| Validate airbyte-integrations/connectors/source-salesforce/metadata.yaml | ✅ |
| Connector version semver check | ✅ |
| Connector version increment check | ✅ |
| QA checks | ✅ |
| Code format checks | ✅ |
| Connector package install | ✅ |
| Build source-salesforce docker image for platform linux/x86_64 | ✅ |
| Unit tests | ❌ |
☁️ 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-salesforce test
|
| Step | Result |
|---|---|
| Validate airbyte-integrations/connectors/source-salesforce/metadata.yaml | ✅ |
| Connector version semver check | ✅ |
| Connector version increment check | ✅ |
| QA checks | ✅ |
| Code format checks | ✅ |
| Connector package install | ✅ |
| Build source-salesforce docker image for platform linux/x86_64 | ✅ |
| Unit tests | ✅ |
| Integration tests | ✅ |
| Acceptance tests | ❌ |
☁️ 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-salesforce test
|
| Step | Result |
|---|---|
| Validate airbyte-integrations/connectors/source-salesforce/metadata.yaml | ✅ |
| Connector version semver check | ✅ |
| Connector version increment check | ✅ |
| QA checks | ✅ |
| Code format checks | ✅ |
| Connector package install | ✅ |
| Build source-salesforce docker image for platform linux/x86_64 | ✅ |
| Unit tests | ✅ |
| Integration tests | ✅ |
| Acceptance tests | ✅ |
☁️ 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-salesforce test| self.logger.warning("Filter 'null' bytes from string, size reduced %d -> %d chars", len(b), len(res)) | ||
| return res | ||
|
|
||
| def get_response_encoding(self, headers) -> str: |
There was a problem hiding this comment.
Need to add unit test for this part
| self.logger.warning("Filter 'null' bytes from string, size reduced %d -> %d chars", len(b), len(res)) | ||
| return res | ||
|
|
||
| def get_response_encoding(self, headers) -> str: |
There was a problem hiding this comment.
can you add unit tests for this method? We should test
- headers without a
content-typefield ->returns self.encoding - headers that does not produce a charset in
params(you know better than me what scenario would lead to this) -> returnsself.encoding - headers with a charset in
params-> returnsparams["charset"].strip("'\"")
|
Tank you for this PR 🙏 |
What
Resolve https://github.com/airbytehq/oncall/issues/2737
fix encoding guess if no charset is provided in headers
How
Salesforce used to return charset encoding (charset='iso-8859-1/utf-8/latin-1....') in response
headersbut from now there is only('Content-Type', 'text/csv'). According toHTTP 1.*standardrequestlibrary useiso-8859-1as a default one, whileutf-8should be used instead.Try to use charset from Content-Type, otherwise use default encoding.
Recommended reading order
streams.py🚨 User Impact 🚨
no breaking changes
Pre-merge Actions
Updating a connector
Community member or Airbyter
Airbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.