-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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 Salesforce: Use Apparent Encoding #19294
🐛 Source Salesforce: Use Apparent Encoding #19294
Conversation
@PierreKerschgens thanks for your contribution. I'm one of the Airbyte maintainers and will take a look at your PR |
…-apparent-encoding
/test connector=connectors/source-salesforce
Build PassedTest summary info:
|
/publish connector=connectors/source-salesforce run-tests=false
if you have connectors that successfully published but failed definition generation, follow step 4 here |
* fix: prefer response body encoding over header encoding * bump: source-salesforce version * Update salesforce.md * auto-bump connector version Co-authored-by: Vincent Koc <[email protected]> Co-authored-by: Octavia Squidington III <[email protected]>
What
Hey everybody,
I opened an issue about inconsistent encodings in my Salesforce raw output data.
Fixes: #14659
Fixes: #19289
How
Before Airbyte starts fetching data it checks Salesforce's response for the encoding.
The previous (and at least not for me) working order of encoding determination was:
DEFAULT_ENCODING = "utf-8"
I inverted the order of encoding determination to:
DEFAULT_ENCODING = "utf-8"
My sample output files are consistent and properly encoded now.
Pre-merge Checklist
Expand the relevant checklist and delete the others.
New Connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampledocs/integrations/README.md
airbyte-integrations/builds.md
Airbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing/publish
command described hereUpdating a connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampleAirbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing/publish
command described hereConnector Generator
-scaffold
in their name) have been updated with the latest scaffold by running./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates
then checking in your changesTests
Unfortunately I don't have sufficient permissions to perform 1 of the 6 integration test.
The acceptance-test didn't fully work because my Salesforce sandbox account has no data in the 'Asset' table.
Apart from that it looks good.
Unit
========================================================================================================== warnings summary ===========================================================================================================
source_salesforce/exceptions.py:13
/Users/trupke/devel/git/airbyte/airbyte-integrations/connectors/source-salesforce/source_salesforce/exceptions.py:13: DeprecationWarning: Call to deprecated class AirbyteLogger. (Use logging.getLogger('airbyte') instead) -- Deprecated since version 0.1.47.
logger = AirbyteLogger()
source_salesforce/rate_limiting.py:21
/Users/trupke/devel/git/airbyte/airbyte-integrations/connectors/source-salesforce/source_salesforce/rate_limiting.py:21: DeprecationWarning: Call to deprecated class AirbyteLogger. (Use logging.getLogger('airbyte') instead) -- Deprecated since version 0.1.47.
logger = AirbyteLogger()
airbyte-integrations/connectors/source-salesforce/unit_tests/api_test.py: 49 warnings
airbyte-integrations/connectors/source-salesforce/unit_tests/test_memory.py: 4 warnings
/Users/trupke/devel/git/airbyte/airbyte-integrations/connectors/source-salesforce/source_salesforce/source.py:82: DeprecationWarning: Call to deprecated class TokenAuthenticator. (Use airbyte_cdk.sources.streams.http.requests_native_auth.TokenAuthenticator instead) -- Deprecated since version 0.1.20.
authenticator = TokenAuthenticator(sf_object.access_token)
airbyte-integrations/connectors/source-salesforce/unit_tests/api_test.py: 102 warnings
airbyte-integrations/connectors/source-salesforce/unit_tests/test_memory.py: 8 warnings
/Users/trupke/devel/git/airbyte/airbyte-integrations/connectors/source-salesforce/.venv/lib/python3.9/site-packages/deprecated/classic.py:173: DeprecationWarning: Call to deprecated class HttpAuthenticator. (Use requests.auth.AuthBase instead) -- Deprecated since version 0.1.20.
return old_new1(cls, *args, **kwargs)
airbyte-integrations/connectors/source-salesforce/unit_tests/api_test.py: 53 warnings
airbyte-integrations/connectors/source-salesforce/unit_tests/test_memory.py: 4 warnings
/Users/trupke/devel/git/airbyte/airbyte-integrations/connectors/source-salesforce/.venv/lib/python3.9/site-packages/airbyte_cdk/sources/streams/http/http.py:43: DeprecationWarning: Call to deprecated class NoAuth. (Set
authenticator=None
instead) -- Deprecated since version 0.1.20.self._authenticator: HttpAuthenticator = NoAuth()
airbyte-integrations/connectors/source-salesforce/unit_tests/api_test.py::test_check_connection_rate_limit[403-login_json_resp0-200-discovery_resp_json0-API Call limit is exceeded]
airbyte-integrations/connectors/source-salesforce/unit_tests/api_test.py::test_check_connection_rate_limit[200-login_json_resp1-403-discovery_resp_json1-An error occurred: [{"errorCode": "FORBIDDEN", "message": "You do not have enough permissions"}]]
/Users/trupke/devel/git/airbyte/airbyte-integrations/connectors/source-salesforce/source_salesforce/api.py:271: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead
self.logger.warn(f"http error body: {err.response.text}")
airbyte-integrations/connectors/source-salesforce/unit_tests/api_test.py::test_check_connection_rate_limit[403-login_json_resp0-200-discovery_resp_json0-API Call limit is exceeded]
/Users/trupke/devel/git/airbyte/airbyte-integrations/connectors/source-salesforce/source_salesforce/source.py:51: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead
logger.warn(f"API Call limit is exceeded. Error message: '{error_data.get('message')}'")
airbyte-integrations/connectors/source-salesforce/unit_tests/api_test.py::test_rate_limit_bulk
airbyte-integrations/connectors/source-salesforce/unit_tests/api_test.py::test_rate_limit_rest
/Users/trupke/devel/git/airbyte/airbyte-integrations/connectors/source-salesforce/source_salesforce/source.py:142: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead
logger.warn(f"API Call limit is exceeded. Error message: '{error_data.get('message')}'")
airbyte-integrations/connectors/source-salesforce/unit_tests/discovery_test.py::test_discover_only_queryable
/Users/trupke/devel/git/airbyte/airbyte-integrations/connectors/source-salesforce/source_salesforce/api.py:239: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead
self.logger.warn(f"Stream {stream_object['name']} is not queryable and will be ignored.")
-- Docs: https://docs.pytest.org/en/stable/warnings.html
Results (66.47s):
71 passed
Integration
======================================================================================================= short test summary info =======================================================================================================
FAILED integration_tests/bulk_error_test.py::test_failed_jobs_with_successful_switching[failed_switching] - Failed: insufficient access rights on cross-reference id is missing from captured log
Results (168.41s):
5 passed
1 failed
- airbyte-integrations/connectors/source-salesforce/integration_tests/bulk_error_test.py:58 test_failed_jobs_with_successful_switching[failed_switching]
Acceptance
======================================================================================================= short test summary info =======================================================================================================
FAILED ../../bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestBasicRead::test_read[inputs0] - AssertionError: All streams should return some records, streams without records: {'Asset'}
Results (1286.09s):
30 passed
1 failed
- airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py:537 TestBasicRead.test_read[inputs0]