Skip to content
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

Collection fails when running acceptance tests in python 3.10 env of low-code configuration source #17855

Closed
josix opened this issue Oct 11, 2022 · 3 comments
Labels
area/connectors Connector related issues community team/extensibility type/bug Something isn't working

Comments

@josix
Copy link
Contributor

josix commented Oct 11, 2022

Environment

  • Airbyte version: 0.40.10
  • OS Version / Instance: macOS
  • Deployment: Docker
  • Source Connector and version: 🎉 New Source: ClickUp #17770 or source-exchange-rates
  • Step where error happened: acceptance tests

Current Behavior

When I running acceptance tests by command docker build . -t airbyte/source-clickup-api:dev; python -m pytest integration_tests -p integration_tests.acceptance in my low-code configured source. The TypeError: DegenerateFiles.Path.open() got an unexpected keyword argument 'encoding' occured in each testcase. But it is okay when I running the same command in Python 3.9.13. It probably related to this issue, but I'm unsure if it is the root reason of the error.

Expected Behavior

The testing should be runable like using 3.9.13 venv, as follows.

se 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
Test session starts (platform: darwin, Python 3.9.13, pytest 6.2.5, pytest-sugar 0.9.5)
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/Users/wilson/wilson/sideproject/airbyte/airbyte-integrations/connectors/source-clickup-api/.hypothesis/examples')
rootdir: /Users/wilson/wilson/sideproject/airbyte, configfile: pytest.ini
plugins: hypothesis-6.54.6, sugar-0.9.5, requests-mock-1.9.3, mock-3.6.1, timeout-1.4.2, cov-3.0.0
collecting ... 
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_config_match_spec[inputs0] ✓                                                                            4% ▍         
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_match_expected[inputs0] ✓                                                                               8% ▊         
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_docker_env[inputs0] ✓                                                                                  12% █▎        
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_oneof_usage[inputs0] ✓                                                                                 15% █▋        
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_required[inputs0] ✓                                                                                    19% █▉        
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_optional[inputs0] ✓                                                                                    23% ██▍       
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_has_secret[inputs0] ✓                                                                                  27% ██▊       
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_secret_never_in_the_output[inputs0] ✓                                                                  31% ███▏      
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_defined_refs_exist_in_json_spec_file[inputs0] ✓                                                        35% ███▌      
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_oauth_flow_parameters[inputs0] ✓                                                                       38% ███▉      Pulling docker image airbyte/source-clickup-api:latest
{"type": "LOG", "log": {"level": "WARN", "message": "\n We did not find the airbyte/source-clickup-api:latest image for this connector. This probably means this version has not yet been published to an accessible docker registry like DockerHub."}}

 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_backward_compatibility[inputs0] s                                                                      42% ████▎     
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_additional_properties_is_true[inputs0] ✓                                                               46% ████▋     
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestConnection.test_check[inputs0] ✓                                                                                 50% █████     
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestConnection.test_check[inputs1] ✓                                                                                 54% █████▍    
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestDiscovery.test_discover[inputs0] ✓                                                                               58% █████▊    
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestDiscovery.test_defined_cursors_exist_in_schema[inputs0] ✓                                                        62% ██████▎   
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestDiscovery.test_defined_refs_exist_in_schema[inputs0] ✓                                                           65% ██████▋   
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestDiscovery.test_defined_keyword_exist_in_schema[inputs0-allOf] ✓                                                  69% ██████▉   
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestDiscovery.test_defined_keyword_exist_in_schema[inputs0-not] ✓                                                    73% ███████▍  
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestDiscovery.test_primary_keys_exist_in_schema[inputs0] ✓                                                           77% ███████▊  
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestDiscovery.test_streams_has_sync_modes[inputs0] ✓                                                                 81% ████████▏ 
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestDiscovery.test_additional_properties_is_true[inputs0] ✓                                                          85% ████████▌ Pulling docker image airbyte/source-clickup-api:latest
{"type": "LOG", "log": {"level": "WARN", "message": "\n We did not find the airbyte/source-clickup-api:latest image for this connector. This probably means this version has not yet been published to an accessible docker registry like DockerHub."}}

 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestDiscovery.test_backward_compatibility[inputs0] s                                                                 88% ████████▉ 
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestBasicRead.test_read[inputs0] ✓                                                                                   92% █████████

Logs

Testing Logs
Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
Test session starts (platform: darwin, Python 3.10.0, pytest 6.2.5, pytest-sugar 0.9.5)
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/Users/wilson/wilson/sideproject/airbyte/airbyte-integrations/connectors/source-clickup-api/.hypothesis/examples')
rootdir: /Users/wilson/wilson/sideproject/airbyte, configfile: pytest.ini
plugins: hypothesis-6.54.6, sugar-0.9.5, requests-mock-1.9.3, mock-3.6.1, timeout-1.4.2, cov-3.0.0
collecting ... 
――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ERROR collecting airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
../../bases/source-acceptance-test/source_acceptance_test/tests/test_core.py:32: in <module>
    from source_acceptance_test.utils.backward_compatibility import CatalogDiffChecker, SpecDiffChecker, validate_previous_configs
../../bases/source-acceptance-test/source_acceptance_test/utils/backward_compatibility.py:12: in <module>
    from hypothesis_jsonschema import from_schema
.3.10.venv/lib/python3.10/site-packages/hypothesis_jsonschema/__init__.py:9: in <module>
    from ._from_schema import from_schema
.3.10.venv/lib/python3.10/site-packages/hypothesis_jsonschema/_from_schema.py:13: in <module>
    from hypothesis import assume, provisional as prov, strategies as st
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:688: in _load_unlocked
    ???
.3.10.venv/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:170: in exec_module
    exec(co, module.__dict__)
.3.10.venv/lib/python3.10/site-packages/hypothesis/provisional.py:37: in <module>
    _tlds = traversable.read_text().splitlines()
/Users/wilson/.pyenv/versions/3.10.0/lib/python3.10/importlib/abc.py:378: in read_text
    with self.open(encoding=encoding) as strm:
E   TypeError: DegenerateFiles.Path.open() got an unexpected keyword argument 'encoding'

――――――――――――――――――――――――――――――――――――――――――――――――――――― ERROR collecting airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_full_refresh.py ――――――――――――――――――――――――――――――――――――――――――――――――――――――
/Users/wilson/.pyenv/versions/3.10.0/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:992: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:688: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:883: in exec_module
    ???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
    ???
../../bases/source-acceptance-test/source_acceptance_test/tests/__init__.py:5: in <module>
    from .test_core import TestBasicRead, TestConnection, TestDiscovery, TestSpec
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:688: in _load_unlocked
    ???
.3.10.venv/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:170: in exec_module
    exec(co, module.__dict__)
../../bases/source-acceptance-test/source_acceptance_test/tests/test_core.py:32: in <module>
    from source_acceptance_test.utils.backward_compatibility import CatalogDiffChecker, SpecDiffChecker, validate_previous_configs
../../bases/source-acceptance-test/source_acceptance_test/utils/backward_compatibility.py:12: in <module>
    from hypothesis_jsonschema import from_schema
.3.10.venv/lib/python3.10/site-packages/hypothesis_jsonschema/__init__.py:9: in <module>
    from ._from_schema import from_schema
.3.10.venv/lib/python3.10/site-packages/hypothesis_jsonschema/_from_schema.py:13: in <module>
    from hypothesis import assume, provisional as prov, strategies as st
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:688: in _load_unlocked
    ???
.3.10.venv/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:170: in exec_module
    exec(co, module.__dict__)
.3.10.venv/lib/python3.10/site-packages/hypothesis/provisional.py:37: in <module>
    _tlds = traversable.read_text().splitlines()
/Users/wilson/.pyenv/versions/3.10.0/lib/python3.10/importlib/abc.py:378: in read_text
    with self.open(encoding=encoding) as strm:
E   TypeError: DegenerateFiles.Path.open() got an unexpected keyword argument 'encoding'

―――――――――――――――――――――――――――――――――――――――――――――――――――――― ERROR collecting airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_incremental.py ――――――――――――――――――――――――――――――――――――――――――――――――――――――
/Users/wilson/.pyenv/versions/3.10.0/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:992: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:688: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:883: in exec_module
    ???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
    ???
../../bases/source-acceptance-test/source_acceptance_test/tests/__init__.py:5: in <module>
    from .test_core import TestBasicRead, TestConnection, TestDiscovery, TestSpec
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:688: in _load_unlocked
    ???
.3.10.venv/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:170: in exec_module
    exec(co, module.__dict__)
../../bases/source-acceptance-test/source_acceptance_test/tests/test_core.py:32: in <module>
    from source_acceptance_test.utils.backward_compatibility import CatalogDiffChecker, SpecDiffChecker, validate_previous_configs
../../bases/source-acceptance-test/source_acceptance_test/utils/backward_compatibility.py:12: in <module>
    from hypothesis_jsonschema import from_schema
.3.10.venv/lib/python3.10/site-packages/hypothesis_jsonschema/__init__.py:9: in <module>
    from ._from_schema import from_schema
.3.10.venv/lib/python3.10/site-packages/hypothesis_jsonschema/_from_schema.py:13: in <module>
    from hypothesis import assume, provisional as prov, strategies as st
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:688: in _load_unlocked
    ???
.3.10.venv/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:170: in exec_module
    exec(co, module.__dict__)
.3.10.venv/lib/python3.10/site-packages/hypothesis/provisional.py:37: in <module>
    _tlds = traversable.read_text().splitlines()
/Users/wilson/.pyenv/versions/3.10.0/lib/python3.10/importlib/abc.py:378: in read_text
    with self.open(encoding=encoding) as strm:
E   TypeError: DegenerateFiles.Path.open() got an unexpected keyword argument 'encoding'

{"type": "LOG", "log": {"level": "INFO", "message": "/Users/wilson/wilson/sideproject/airbyte/airbyte-integrations/connectors/source-clickup-api - SAT run - e01b314284ace98cba122d7460f173f3fdaafc31 - FAILED"}}

==================================================================================================== short test summary info ====================================================================================================
FAILED ../../bases/source-acceptance-test/source_acceptance_test/tests/test_core.py - TypeError: DegenerateFiles.Path.open() got an unexpected keyword argument 'encoding'
FAILED ../../bases/source-acceptance-test/source_acceptance_test/tests/test_full_refresh.py - TypeError: DegenerateFiles.Path.open() got an unexpected keyword argument 'encoding'
FAILED ../../bases/source-acceptance-test/source_acceptance_test/tests/test_incremental.py - TypeError: DegenerateFiles.Path.open() got an unexpected keyword argument 'encoding'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Results (0.50s):

Steps to Reproduce

  1. Pulling code from PR or go to source source-exchange-rates
  2. Go to airbyte/airbyte-integrations/connectors/source-clickup-api and setup virtualenv with python3.10 -m venv .venv
  3. Running docker build . -t airbyte/source-clickup-api:dev; python -m pytest integration_tests -p integration_tests.acceptance

Are you willing to submit a PR?

yes

@josix josix added needs-triage type/bug Something isn't working labels Oct 11, 2022
@sajarin sajarin added area/connectors Connector related issues from/connector-ops and removed needs-triage team/tse Technical Support Engineers autoteam labels Oct 12, 2022
@sajarin
Copy link
Contributor

sajarin commented Oct 12, 2022

Thanks for the issue @josix, what is your proposed fix here?

@josix
Copy link
Contributor Author

josix commented Oct 15, 2022

Hello @sajarin I'm unsure if changing pytest version would be sufficient, or is this a python importlib bug. I'm still figuring it out. Do you have suggestions about it?

@sherifnada
Copy link
Contributor

fwiw the CDK supports 3.9 only at the moment. Closing this issue as it will be solved as part of 3.10 or 3.11 upgrade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues community team/extensibility type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants