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

Source Firebolt: allow reading from views #16583

Merged
merged 14 commits into from
Dec 7, 2022
Merged

Source Firebolt: allow reading from views #16583

merged 14 commits into from
Dec 7, 2022

Conversation

ptiurin
Copy link
Contributor

@ptiurin ptiurin commented Sep 12, 2022

What

Allow using views the same way as tables to read data from in the Source. Views now appear in the same list in Replication settings in UI.

How

Changing the query that only shows tables and their columns to the one that shows columns for views as well.

Recommended reading order

  1. database.py
  2. source.py
  3. the rest

🚨 User Impact 🚨

Are there any breaking changes? What is the end result perceived by the user? If yes, please merge this PR with the 🚨🚨 emoji so changelog authors can further highlight this if needed.

Fixed a bug where ARRAY(INT) whould be {"type": "array", "items": {"type": ["null", "string"]}} instead of {"type": "array", "items": {"type": ["null", "integer"]}}

Pre-merge Checklist

Expand the relevant checklist and delete the others.

Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub and connector version bumped by running the /publish command described here

Tests

Unit
         ============================= test session starts ==============================
         platform darwin -- Python 3.9.12, pytest-6.1.2, py-1.11.0, pluggy-0.13.1 -- /Users/petrotiurin/Development/airbyte/airbyte-integrations/connectors/source-firebolt/.venv/bin/python
         cachedir: .pytest_cache
         hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/Users/petrotiurin/Development/airbyte/airbyte-integrations/connectors/source-firebolt/.hypothesis/examples')
         rootdir: /Users/petrotiurin/Development/airbyte/airbyte-integrations/connectors/source-firebolt/unit_tests, configfile: ../../../../pyproject.toml
         plugins: sugar-0.9.4, asyncio-0.18.3, anyio-3.5.0, requests-mock-1.9.3, mock-3.6.1, timeout-1.4.2, hypothesis-6.54.5, cov-3.0.0
         asyncio: mode=legacy
         collecting ... collected 31 items
         
         unit_tests/test_firebolt_source.py::test_parse_config[my_engine] PASSED
         unit_tests/test_firebolt_source.py::test_parse_config[my_engine.api.firebolt.io] PASSED
         unit_tests/test_firebolt_source.py::test_connection[my_engine] PASSED
         unit_tests/test_firebolt_source.py::test_connection[my_engine.api.firebolt.io] PASSED
         unit_tests/test_firebolt_source.py::test_convert_type[VARCHAR-False-result0] PASSED
         unit_tests/test_firebolt_source.py::test_convert_type[INT-False-result1] PASSED
         unit_tests/test_firebolt_source.py::test_convert_type[int-False-result2] PASSED
         unit_tests/test_firebolt_source.py::test_convert_type[LONG-False-result3] PASSED
         unit_tests/test_firebolt_source.py::test_convert_type[DECIMAL(4,15)-False-result4] PASSED
         unit_tests/test_firebolt_source.py::test_convert_type[TIMESTAMP-False-result5] PASSED
         unit_tests/test_firebolt_source.py::test_convert_type[ARRAY(ARRAY(INT NOT NULL))-False-result6] PASSED
         unit_tests/test_firebolt_source.py::test_convert_type[int-True-result7] PASSED
         unit_tests/test_firebolt_source.py::test_convert_type[DUMMY-False-result8] PASSED
         unit_tests/test_firebolt_source.py::test_convert_type[boolean-False-result9] PASSED
         unit_tests/test_firebolt_source.py::test_format_fetch_result[data0-expected0] PASSED
         unit_tests/test_firebolt_source.py::test_format_fetch_result[data1-expected1] PASSED
         unit_tests/test_firebolt_source.py::test_format_fetch_result[data2-expected2] PASSED
         unit_tests/test_firebolt_source.py::test_format_fetch_result[data3-expected3] PASSED
         unit_tests/test_firebolt_source.py::test_format_fetch_result[data4-expected4] PASSED
         unit_tests/test_firebolt_source.py::test_airbyte_message_from_data PASSED
         unit_tests/test_firebolt_source.py::test_airbyte_message_from_data_no_data PASSED
         unit_tests/test_firebolt_source.py::test_get_firebolt_tables {"type": "DEBUG", "message": "Using selector: KqueueSelector", "data": {}}
         {"type": "DEBUG", "message": "Using selector: KqueueSelector", "data": {}}
         PASSED{"type": "DEBUG", "message": "Using selector: KqueueSelector", "data": {}}
         
         unit_tests/test_firebolt_source.py::test_get_table_stream {"type": "DEBUG", "message": "Using selector: KqueueSelector", "data": {}}
         PASSED{"type": "DEBUG", "message": "Using selector: KqueueSelector", "data": {}}
         
         unit_tests/test_firebolt_source.py::test_check[my_engine] PASSED
         unit_tests/test_firebolt_source.py::test_check[my_engine.api.firebolt.io] PASSED
         unit_tests/test_firebolt_source.py::test_discover[my_engine] PASSED
         unit_tests/test_firebolt_source.py::test_discover[my_engine.api.firebolt.io] PASSED
         unit_tests/test_firebolt_source.py::test_read_no_state[my_engine] PASSED
         unit_tests/test_firebolt_source.py::test_read_no_state[my_engine.api.firebolt.io] PASSED
         unit_tests/test_firebolt_source.py::test_read_special_types_no_state[my_engine] PASSED
         unit_tests/test_firebolt_source.py::test_read_special_types_no_state[my_engine.api.firebolt.io] PASSED
         
         =============================== warnings summary ===============================
         .venv/lib/python3.9/site-packages/pytest_asyncio/plugin.py:191
           /Users/petrotiurin/Development/airbyte/airbyte-integrations/connectors/source-firebolt/.venv/lib/python3.9/site-packages/pytest_asyncio/plugin.py:191: DeprecationWarning: The 'asyncio_mode' default value will change to 'strict' in future, please explicitly use 'asyncio_mode=strict' or 'asyncio_mode=auto' in pytest configuration file.
             config.issue_config_time_warning(LEGACY_MODE, stacklevel=2)
         
         test_firebolt_source.py::test_get_table_stream
           /Users/petrotiurin/Development/airbyte/airbyte-integrations/connectors/source-firebolt/source_firebolt/source.py:42: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
             cursor.close()
         
         -- Docs: https://docs.pytest.org/en/stable/warnings.html
         ======================== 31 passed, 2 warnings in 0.74s ========================

> Task :airbyte-integrations:connectors:source-firebolt:unitTest
Name                          Stmts   Miss  Cover
-------------------------------------------------
source_firebolt/utils.py         34      0   100%
source_firebolt/__init__.py       2      0   100%
source_firebolt/source.py        56      1    98%
source_firebolt/database.py      32      4    88%
-------------------------------------------------
TOTAL                           124      5    96%

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.4/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 23s
33 actionable tasks: 15 executed, 18 up-to-date
Integration
> Task :airbyte-integrations:connectors:source-firebolt:_customIntegrationTestsCoverage
[python] .venv/bin/python -m coverage run --data-file=integration_tests/.coverage.customIntegrationTests --rcfile=/Users/petrotiurin/Development/airbyte/pyproject.toml -m pytest -s integration_tests -c /Users/petrotiurin/Development/airbyte/pyproject.toml
         ============================= test session starts ==============================
         platform darwin -- Python 3.9.12, pytest-6.1.2, py-1.11.0, pluggy-0.13.1 -- /Users/petrotiurin/Development/airbyte/airbyte-integrations/connectors/source-firebolt/.venv/bin/python
         cachedir: .pytest_cache
         hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/Users/petrotiurin/Development/airbyte/airbyte-integrations/connectors/source-firebolt/.hypothesis/examples')
         rootdir: /Users/petrotiurin/Development/airbyte/airbyte-integrations/connectors/source-firebolt/integration_tests, configfile: ../../../../pyproject.toml
         plugins: sugar-0.9.4, asyncio-0.18.3, anyio-3.5.0, requests-mock-1.9.3, mock-3.6.1, timeout-1.4.2, hypothesis-6.54.5, cov-3.0.0
         asyncio: mode=legacy
         collecting ... collected 5 items
         
         integration_tests/integration_test.py::test_check_fails {"type": "DEBUG", "message": "Using selector: KqueueSelector", "data": {}}
         {"type": "DEBUG", "message": "HTTP Request: POST https://api.app.firebolt.io/auth/v1/login \"HTTP/1.1 429 Too Many Requests\"", "data": {}}
         PASSED
         integration_tests/integration_test.py::test_check_succeeds {"type": "DEBUG", "message": "Detected running from packages: {}", "data": {}}
         {"type": "DEBUG", "message": "Python 3.9.12 detected. SDK 0.8.1 OS Darwin 21.1.0 ", "data": {}}
         {"type": "DEBUG", "message": "Running query: SELECT 1", "data": {}}
         {"type": "DEBUG", "message": "HTTP Request: POST https://petro-test-general-purpose.firebolt.us-east-1.app.firebolt.io/?database=petro_test&output_format=JSONCompact \"HTTP/1.1 200 OK\"", "data": {}}
         {"type": "LOG", "log": {"level": "INFO", "message": "Query fetched 1 rows in 0.3477911949157715 seconds"}}
         PASSED
         integration_tests/integration_test.py::test_discover {"type": "DEBUG", "message": "Detected running from packages: {}", "data": {}}
         {"type": "DEBUG", "message": "Python 3.9.12 detected. SDK 0.8.1 OS Darwin 21.1.0 ", "data": {}}
         {"type": "DEBUG", "message": "Running query: CREATE DIMENSION TABLE airbyte_integration_okcbgrvkyv (column1 STRING NULL, column2 INT NULL, column3 DATE NULL, column4 DATETIME NULL, column5 DECIMAL(38, 31) NULL, column6 ARRAY(INT), column7 BOOLEAN NULL)", "data": {}}
         {"type": "DEBUG", "message": "HTTP Request: POST https://petro-test-general-purpose.firebolt.us-east-1.app.firebolt.io/?database=petro_test&output_format=JSONCompact \"HTTP/1.1 200 OK\"", "data": {}}
         {"type": "LOG", "log": {"level": "INFO", "message": "Query fetched 1 rows in 0.47776103019714355 seconds"}}
         {"type": "DEBUG", "message": "Running query: INSERT INTO airbyte_integration_okcbgrvkyv VALUES ('my_value',221,'2021-01-01','2021-01-01 12:00:01', Null, [1,2,3], true), ('my_value2',null,'2021-01-02','2021-01-02 12:00:02','1231232.1234599999904570548442587065362', [1,2,3], null)", "data": {}}
         {"type": "DEBUG", "message": "HTTP Request: POST https://petro-test-general-purpose.firebolt.us-east-1.app.firebolt.io/?database=petro_test&output_format=JSONCompact \"HTTP/1.1 200 OK\"", "data": {}}
         {"type": "LOG", "log": {"level": "INFO", "message": "Query fetched 0 rows in 17.104991912841797 seconds"}}
         {"type": "DEBUG", "message": "Running query: CREATE VIEW view_airbyte_integration_okcbgrvkyv AS SELECT column1, column2 FROM airbyte_integration_okcbgrvkyv", "data": {}}
         {"type": "DEBUG", "message": "HTTP Request: POST https://petro-test-general-purpose.firebolt.us-east-1.app.firebolt.io/?database=petro_test&output_format=JSONCompact \"HTTP/1.1 200 OK\"", "data": {}}
         {"type": "LOG", "log": {"level": "INFO", "message": "Query fetched 1 rows in 0.23284029960632324 seconds"}}
         {"type": "DEBUG", "message": "Detected running from packages: {}", "data": {}}
         {"type": "DEBUG", "message": "Python 3.9.12 detected. SDK 0.8.1 OS Darwin 21.1.0 ", "data": {}}
         {"type": "DEBUG", "message": "Running query: SELECT\n        table_name\n    FROM\n        information_schema.tables\n    WHERE\n        \"table_type\" IN ('FACT', 'DIMENSION')\n    UNION ALL\n    SELECT\n        table_name\n    FROM\n        information_schema.views", "data": {}}
         {"type": "DEBUG", "message": "HTTP Request: POST https://petro-test-general-purpose.firebolt.us-east-1.app.firebolt.io/?database=petro_test&output_format=JSONCompact \"HTTP/1.1 200 OK\"", "data": {}}
         {"type": "LOG", "log": {"level": "INFO", "message": "Query fetched 6 rows in 0.37266993522644043 seconds"}}
         {"type": "DEBUG", "message": "Running query: SELECT column_name, data_type, is_nullable FROM information_schema.columns where table_name='airbyte_acceptance_table'", "data": {}}
         {"type": "DEBUG", "message": "Running query: SELECT column_name, data_type, is_nullable FROM information_schema.columns where table_name='airbyte_integration_okcbgrvkyv'", "data": {}}
         {"type": "DEBUG", "message": "Running query: SELECT column_name, data_type, is_nullable FROM information_schema.columns where table_name='_airbyte_raw_move_view_test'", "data": {}}
         {"type": "DEBUG", "message": "Running query: SELECT column_name, data_type, is_nullable FROM information_schema.columns where table_name='_airbyte_raw_view_test'", "data": {}}
         {"type": "DEBUG", "message": "Running query: SELECT column_name, data_type, is_nullable FROM information_schema.columns where table_name='view_airbyte_integration_okcbgrvkyv'", "data": {}}
         {"type": "DEBUG", "message": "Running query: SELECT column_name, data_type, is_nullable FROM information_schema.columns where table_name='view_test'", "data": {}}
         {"type": "DEBUG", "message": "HTTP Request: POST https://petro-test-general-purpose.firebolt.us-east-1.app.firebolt.io/?database=petro_test&output_format=JSONCompact \"HTTP/1.1 200 OK\"", "data": {}}
         {"type": "LOG", "log": {"level": "INFO", "message": "Query fetched 5 rows in 0.10500311851501465 seconds"}}
         {"type": "DEBUG", "message": "HTTP Request: POST https://petro-test-general-purpose.firebolt.us-east-1.app.firebolt.io/?database=petro_test&output_format=JSONCompact \"HTTP/1.1 200 OK\"", "data": {}}
         {"type": "LOG", "log": {"level": "INFO", "message": "Query fetched 5 rows in 0.3582451343536377 seconds"}}
         {"type": "DEBUG", "message": "HTTP Request: POST https://petro-test-general-purpose.firebolt.us-east-1.app.firebolt.io/?database=petro_test&output_format=JSONCompact \"HTTP/1.1 200 OK\"", "data": {}}
         {"type": "LOG", "log": {"level": "INFO", "message": "Query fetched 3 rows in 0.37125420570373535 seconds"}}
         {"type": "DEBUG", "message": "HTTP Request: POST https://petro-test-general-purpose.firebolt.us-east-1.app.firebolt.io/?database=petro_test&output_format=JSONCompact \"HTTP/1.1 200 OK\"", "data": {}}
         {"type": "LOG", "log": {"level": "INFO", "message": "Query fetched 3 rows in 0.38649487495422363 seconds"}}
         {"type": "DEBUG", "message": "HTTP Request: POST https://petro-test-general-purpose.firebolt.us-east-1.app.firebolt.io/?database=petro_test&output_format=JSONCompact \"HTTP/1.1 200 OK\"", "data": {}}
         {"type": "LOG", "log": {"level": "INFO", "message": "Query fetched 7 rows in 0.39844298362731934 seconds"}}
         {"type": "DEBUG", "message": "HTTP Request: POST https://petro-test-general-purpose.firebolt.us-east-1.app.firebolt.io/?database=petro_test&output_format=JSONCompact \"HTTP/1.1 200 OK\"", "data": {}}
         {"type": "LOG", "log": {"level": "INFO", "message": "Query fetched 2 rows in 0.4022221565246582 seconds"}}
         PASSED
         integration_tests/integration_test.py::test_read {"type": "DEBUG", "message": "Detected running from packages: {}", "data": {}}
         {"type": "DEBUG", "message": "Python 3.9.12 detected. SDK 0.8.1 OS Darwin 21.1.0 ", "data": {}}
         {"type": "DEBUG", "message": "Running query: SELECT \"column2\",\"column3\",\"column4\",\"column5\",\"column6\",\"column7\" FROM airbyte_integration_okcbgrvkyv", "data": {}}
         {"type": "DEBUG", "message": "HTTP Request: POST https://petro-test-general-purpose.firebolt.us-east-1.app.firebolt.io/?database=petro_test&output_format=JSONCompact \"HTTP/1.1 200 OK\"", "data": {}}
         {"type": "LOG", "log": {"level": "INFO", "message": "Query fetched 2 rows in 0.33341169357299805 seconds"}}
         PASSED
         integration_tests/integration_test.py::test_view_read {"type": "DEBUG", "message": "Detected running from packages: {}", "data": {}}
         {"type": "DEBUG", "message": "Python 3.9.12 detected. SDK 0.8.1 OS Darwin 21.1.0 ", "data": {}}
         {"type": "DEBUG", "message": "Running query: SELECT \"column1\",\"column2\" FROM view_airbyte_integration_okcbgrvkyv", "data": {}}
         {"type": "DEBUG", "message": "HTTP Request: POST https://petro-test-general-purpose.firebolt.us-east-1.app.firebolt.io/?database=petro_test&output_format=JSONCompact \"HTTP/1.1 200 OK\"", "data": {}}
         {"type": "LOG", "log": {"level": "INFO", "message": "Query fetched 2 rows in 0.3472328186035156 seconds"}}
         PASSED{"type": "DEBUG", "message": "Running query: DROP TABLE airbyte_integration_okcbgrvkyv CASCADE", "data": {}}
         {"type": "DEBUG", "message": "HTTP Request: POST https://petro-test-general-purpose.firebolt.us-east-1.app.firebolt.io/?database=petro_test&output_format=JSONCompact \"HTTP/1.1 200 OK\"", "data": {}}
         {"type": "LOG", "log": {"level": "INFO", "message": "Query fetched 1 rows in 4.003904104232788 seconds"}}
         
         
         =============================== warnings summary ===============================
         .venv/lib/python3.9/site-packages/pytest_asyncio/plugin.py:191
           /Users/petrotiurin/Development/airbyte/airbyte-integrations/connectors/source-firebolt/.venv/lib/python3.9/site-packages/pytest_asyncio/plugin.py:191: DeprecationWarning: The 'asyncio_mode' default value will change to 'strict' in future, please explicitly use 'asyncio_mode=strict' or 'asyncio_mode=auto' in pytest configuration file.
             config.issue_config_time_warning(LEGACY_MODE, stacklevel=2)
         
         -- Docs: https://docs.pytest.org/en/stable/warnings.html
         ======================== 5 passed, 1 warning in 24.86s =========================
Acceptance

Backwards-compatibility's failing due to the bugfix described above.

> Task :airbyte-integrations:connectors:source-firebolt:sourceAcceptanceTest
============================= test session starts ==============================
platform linux -- Python 3.9.11, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /test_input
plugins: requests-mock-1.9.3, sugar-0.9.5, timeout-1.4.2, mock-3.6.1, cov-3.0.0, hypothesis-6.54.5
collected 26 items / 1 skipped / 25 selected

test_core.py ......................F..                                   [ 96%]
test_full_refresh.py .                                                   [100%]


=================================== FAILURES ===================================
______________ TestDiscovery.test_backward_compatibility[inputs0] ______________

self = <source_acceptance_test.tests.test_core.TestDiscovery object at 0xffff8d712370>
skip_backward_compatibility_tests = False
discovered_catalog = {'_airbyte_raw_move_view_test': AirbyteStream(name='_airbyte_raw_move_view_test', json_schema={'type': 'object', 'prop...ll_refresh'>], source_defined_cursor=None, default_cursor_field=None, source_defined_primary_key=None, namespace=None)}
previous_discovered_catalog = {'_airbyte_raw_move_view_test': AirbyteStream(name='_airbyte_raw_move_view_test', json_schema={'type': 'object', 'prop...ll_refresh'>], source_defined_cursor=None, default_cursor_field=None, source_defined_primary_key=None, namespace=None)}

    @pytest.mark.default_timeout(60)
    @pytest.mark.backward_compatibility
    def test_backward_compatibility(
        self,
        skip_backward_compatibility_tests: bool,
        discovered_catalog: MutableMapping[str, AirbyteStream],
        previous_discovered_catalog: MutableMapping[str, AirbyteStream],
    ):
        """Check if the current catalog is backward_compatible with the previous one."""
        assert isinstance(discovered_catalog, MutableMapping) and isinstance(previous_discovered_catalog, MutableMapping)
        checker = CatalogDiffChecker(previous_discovered_catalog, discovered_catalog)
>       checker.assert_is_backward_compatible()

/usr/local/lib/python3.9/site-packages/source_acceptance_test/tests/test_core.py:321: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.9/site-packages/source_acceptance_test/utils/backward_compatibility.py:215: in assert_is_backward_compatible
    self.check_if_value_of_type_field_changed(self.streams_json_schemas_diff)
/usr/local/lib/python3.9/site-packages/source_acceptance_test/utils/backward_compatibility.py:60: in check_if_value_of_type_field_changed
    self._raise_error("The'type' field value was changed.", diff)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <source_acceptance_test.utils.backward_compatibility.CatalogDiffChecker object at 0xffff8cb74520>
message = "The'type' field value was changed."
diff = {'dictionary_item_added': [<root['view_test'] t1:not present, t2:{'type': 'ob...}>], 'values_changed': [<root['airbyte_acceptance_table']['properties']['column5']['items']['type'][1] t1:'string', t2:'integer'>]}

    def _raise_error(self, message: str, diff: DeepDiff):
>       raise NonBackwardCompatibleError(f"{message}. Diff: {diff.pretty()}", self.context)
E       source_acceptance_test.utils.backward_compatibility.NonBackwardCompatibleError: BackwardIncompatibilityContext.DISCOVER - The'type' field value was changed.. Diff: Item root['view_test'] added to dictionary.
E       Item root['airbyte_acceptance_table']['properties']['column5']['items']['type'][1] removed from iterable.

/usr/local/lib/python3.9/site-packages/source_acceptance_test/utils/backward_compatibility.py:38: NonBackwardCompatibleError
=========================== short test summary info ============================
FAILED test_core.py::TestDiscovery::test_backward_compatibility[inputs0] - so...
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:60: Skipping TestIncremental.test_two_sequential_reads because not found in the config
=================== 1 failed, 25 passed, 1 skipped in 29.18s ===================

> Task :airbyte-integrations:connectors:source-firebolt:sourceAcceptanceTest FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':airbyte-integrations:connectors:source-firebolt:sourceAcceptanceTest'.

@github-actions github-actions bot added area/connectors Connector related issues area/documentation Improvements or additions to documentation labels Sep 12, 2022
@sajarin sajarin added the bounty-L Maintainer program: claimable large bounty PR label Sep 13, 2022
@sajarin
Copy link
Contributor

sajarin commented Sep 13, 2022

Hi @ptiurin thanks for the PR. This PR is part of Airbyte's Community Maintainer program and someone from our community will be assigned to review your PR and help it get merged. Thanks for being patient and thanks for improving this connector.

@YiyangLi
Copy link
Contributor

/test connector=connectors/source-firebolt

@sajarin
Copy link
Contributor

sajarin commented Sep 28, 2022

/test connector=connectors/source-firebolt

🕑 connectors/source-firebolt https://github.com/airbytehq/airbyte/actions/runs/3145119963
❌ connectors/source-firebolt https://github.com/airbytehq/airbyte/actions/runs/3145119963
🐛 https://gradle.com/s/z5rb4ryelpqfs

Build Failed

Test summary info:

	 =========================== short test summary info ============================
	 FAILED integration_tests/integration_test.py::test_discover - AssertionError:...
	 �[31m========================= �[31m�[1m1 failed�[0m, �[32m4 passed�[0m�[31m in 28.35s�[0m�[31m =========================�[0m

@YiyangLi
Copy link
Contributor

@ptiurin
the acceptance test fails in CI, here's the logs, can you advice the steps I should have taken in the dev account?

firebolt.async_db.cursor:cursor.py:432 Running query: INSERT INTO airbyte_integration_pimaefmwrl VALUES ('my_value',221,'2021-01-01','2021-01-01 12:00:01', Null, [1,2,3], true), ('my_value2',null,'2021-01-02','2021-01-02 12:00:02','1231232.1234599999904570548442587065362', [1,2,3], null)
=================================== FAILURES ===================================
	 ________________________________ test_discover _________________________________
	 
	 config = ***'database': 'airbyte_acceptance_tests', 'engine': 'airbyte-acceptance-tests-general-purpose-1.airbyte.us-east-1.app.firebolt.io', 'host': '***', 'password': '***', ...***
	 create_test_data = <firebolt.db.connection.Connection object at 0x7f831f6898b0>
	 test_table_name = 'airbyte_integration_pimaefmwrl'
	 test_view_name = 'view_airbyte_integration_pimaefmwrl'
	 test_stream = AirbyteStream(name='airbyte_integration_pimaefmwrl', json_schema=***'type': 'object', 'properties': ***'column1': ***'type':...ull_refresh'>], source_defined_cursor=None, default_cursor_field=None, source_defined_primary_key=None, namespace=None)
	 test_view_stream = AirbyteStream(name='view_airbyte_integration_pimaefmwrl', json_schema=***'type': 'object', 'properties': ***'column1': ***'t...ull_refresh'>], source_defined_cursor=None, default_cursor_field=None, source_defined_primary_key=None, namespace=None)
	 
	     def test_discover(
	         config: Dict[str, str],
	         create_test_data: Generator[Connection, None, None],
	         test_table_name: str,
	         test_view_name: str,
	         test_stream: AirbyteStream,
	         test_view_stream: AirbyteStream,
	     ):
	         source = SourceFirebolt()
	         catalog = source.discover(MagicMock(), config)
	         assert any(stream.name == test_table_name for stream in catalog.streams), "Test table not found"
	         assert any(stream.name == test_view_name for stream in catalog.streams), "Test view not found"
	         for stream in catalog.streams:
	             if stream.name == test_table_name:
	                 assert stream == test_stream
	             if stream.name == test_view_name:
	 >               assert stream == test_view_stream
	 E               AssertionError: assert AirbyteStream(name='view_airbyte_integration_pimaefmwrl', json_schema=***'type': 'object', 'properties': ***, supported_sync_modes=[<SyncMode.full_refresh: 'full_refresh'>], source_defined_cursor=None, default_cursor_field=None, source_defined_primary_key=None, namespace=None) == AirbyteStream(name='view_airbyte_integration_pimaefmwrl', json_schema=***'type': 'object', 'properties': ***'column1': ***'type': ['null', 'string']***, 'column2': ***'type': ['null', 'integer']***, supported_sync_modes=[<SyncMode.full_refresh: 'full_refresh'>], source_defined_cursor=None, default_cursor_field=None, source_defined_primary_key=None, namespace=None)
	 E                 +AirbyteStream(name='view_airbyte_integration_pimaefmwrl', json_schema=***'type': 'object', 'properties': ***, supported_sync_modes=[<SyncMode.full_refresh: 'full_refresh'>], source_defined_cursor=None, default_cursor_field=None, source_defined_primary_key=None, namespace=None)
	 E                 -AirbyteStream(name='view_airbyte_integration_pimaefmwrl', json_schema=***'type': 'object', 'properties': ***'column1': ***'type': ['null', 'string']***, 'column2': ***'type': ['null', 'integer']***, supported_sync_modes=[<SyncMode.full_refresh: 'full_refresh'>], source_defined_cursor=None, default_cursor_field=None, source_defined_primary_key=None, namespace=None)
	 E                 Full diff:
	 E                 - AirbyteStream(name='view_airbyte_integration_pimaefmwrl', json_schema=***'type': 'object', 'properties': ***'column1': ***'type': ['null', 'string']***, 'column2': ***'type': ['null', 'integer']***, supported_sync_modes=[<SyncMode.full_refresh: 'full_refresh'>], source_defined_cursor=None, default_cursor_field=None, source_defined_primary_key=None, namespace=None)
	 E                 ?                                                                                                         --------------------------------------------------------------------------------  ^^
	 E                 + AirbyteStream(name='view_airbyte_integration_pimaefmwrl', json_schema=***'type': 'object', 'properties': ***, supported_sync_modes=[<SyncMode.full_refresh: 'full_refresh'>], source_defined_cursor=None, default_cursor_field=None, source_defined_primary_key=None, namespace=None)
	 E                 ?                                                                                                           ^
	 
	 integration_tests/integration_test.py:164: AssertionError
	 ------------------------------ Captured log setup ------------------------------

@ptiurin
Copy link
Contributor Author

ptiurin commented Sep 29, 2022

@YiyangLi , Looks like the database you have is slightly out of date. I'll get back to you once the version is updated. That should fix the tests as well.

@ptiurin
Copy link
Contributor Author

ptiurin commented Oct 6, 2022

@YiyangLi , upgrade is done. If you have access to Airbyte's Firebolt account please stop and start the engine again. This will update it and the tests would pass once it's up.

@sajarin
Copy link
Contributor

sajarin commented Oct 6, 2022

/test connector=connectors/source-firebolt

🕑 connectors/source-firebolt https://github.com/airbytehq/airbyte/actions/runs/3199005141
❌ connectors/source-firebolt https://github.com/airbytehq/airbyte/actions/runs/3199005141
🐛 https://gradle.com/s/tod6ww64b7ajc

Build Failed

Test summary info:

=========================== short test summary info ============================
FAILED test_core.py::TestBasicRead::test_read[inputs0] - docker.errors.Contai...
FAILED test_full_refresh.py::TestFullRefresh::test_sequential_reads[inputs0]
ERROR test_core.py::TestDiscovery::test_backward_compatibility[inputs0] - doc...
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:60: Skipping TestIncremental.test_two_sequential_reads because not found in the config
============== 2 failed, 23 passed, 1 skipped, 1 error in 56.93s ===============

@ptiurin
Copy link
Contributor Author

ptiurin commented Oct 7, 2022

test_backward_compatibility is supposed to be failing as this change also fixes a bug that detected ARRAY(INT) as array of strings.
The rest of the tests are succeeding for me locally. Maybe a rerun would solve this?

@YiyangLi
Copy link
Contributor

YiyangLi commented Oct 13, 2022

/test connector=connectors/source-firebolt

🕑 connectors/source-firebolt https://github.com/airbytehq/airbyte/actions/runs/3245730835
❌ connectors/source-firebolt https://github.com/airbytehq/airbyte/actions/runs/3245730835
🐛 https://gradle.com/s/wohbdz472dmqu

Build Failed

Test summary info:

=========================== short test summary info ============================
FAILED test_core.py::TestBasicRead::test_read[inputs0] - docker.errors.Contai...
FAILED test_full_refresh.py::TestFullRefresh::test_sequential_reads[inputs0]
ERROR test_core.py::TestDiscovery::test_backward_compatibility[inputs0] - doc...
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:60: Skipping TestIncremental.test_two_sequential_reads because not found in the config
========= 2 failed, 23 passed, 1 skipped, 1 error in 63.60s (0:01:03) ==========

@YiyangLi
Copy link
Contributor

YiyangLi commented Oct 13, 2022

=========================== short test summary info ============================
FAILED test_core.py::TestBasicRead::test_read[inputs0] - docker.errors.Contai...
FAILED test_full_refresh.py::TestFullRefresh::test_sequential_reads[inputs0]
ERROR test_core.py::TestDiscovery::test_backward_compatibility[inputs0] - doc...
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:60: Skipping TestIncremental.test_two_sequential_reads because not found in the config
========= 2 failed, 23 passed, 1 skipped, 1 error in 63.60s (0:01:03) ==========

@ptiurin sorry for the delayed response. Looks like the tests fail, I could try explain it.

First failure

=================================== FAILURES ===================================
_______________________ TestBasicRead.test_read[inputs0] _______________________

self = <source_acceptance_test.tests.test_core.TestBasicRead object at 0x7f5b55cf7fd0>
connector_config = SecretDict(******)
configured_catalog = ConfiguredAirbyteCatalog(streams=[ConfiguredAirbyteStream(stream=AirbyteStream(name='airbyte_acceptance_table', json_s...: 'full_refresh'>, cursor_field=None, destination_sync_mode=<DestinationSyncMode.append: 'append'>, primary_key=None)])
inputs = BasicReadTestConfig(config_path='secrets/config.json', configured_catalog_path='integration_tests/configured_catalog.j...ds=False), validate_schema=True, validate_data_points=False, expect_trace_message_on_failure=True, timeout_seconds=120)
expected_records = [AirbyteRecordMessage(namespace=None, stream='airbyte_acceptance_table', data=***'column1': 'my_value', 'column2': 221, ...1': 'my_value2', 'column2': 222, 'column3': '2021-01-02T22:10:22', 'column5': [1, 2, None]***, emitted_at=1626172757000)]
docker_runner = <source_acceptance_test.utils.connector_runner.ConnectorRunner object at 0x7f5b55c879a0>
detailed_logger = <Logger detailed_logger /test_input/acceptance_tests_logs/test_core.py__TestBasicRead__test_read[inputs0].txt (DEBUG)>

It looks like there is a txt file called expected_records.txt, the records read from the database doesn't match the one in the static file. Can you help update the file?

https://github.com/airbytehq/airbyte/blob/master/airbyte-integrations/connectors/source-firebolt/integration_tests/expected_records.txt

Second failure

________________ TestFullRefresh.test_sequential_reads[inputs0] ________________

self = <source_acceptance_test.tests.test_full_refresh.TestFullRefresh object at 0x7f5b559ca1c0>
inputs = FullRefreshConfig(config_path='secrets/config.json', configured_catalog_path='integration_tests/configured_catalog.json', timeout_seconds=None, ignored_fields=None)
connector_config = SecretDict(******)
configured_catalog = ConfiguredAirbyteCatalog(streams=[ConfiguredAirbyteStream(stream=AirbyteStream(name='airbyte_acceptance_table', json_s...: 'full_refresh'>, cursor_field=None, destination_sync_mode=<DestinationSyncMode.append: 'append'>, primary_key=None)])
docker_runner = <source_acceptance_test.utils.connector_runner.ConnectorRunner object at 0x7f5b559cac70>
detailed_logger = <Logger detailed_logger /test_input/acceptance_tests_logs/test_full_refresh.py__TestFullRefresh__test_sequential_reads[inputs0].txt (DEBUG)>

    def test_sequential_reads(
        self,
        inputs: ConnectionTestConfig,
        connector_config: SecretDict,
        configured_catalog: ConfiguredAirbyteCatalog,
        docker_runner: ConnectorRunner,
        detailed_logger: Logger,
    ):
        ignored_fields = getattr(inputs, "ignored_fields") or ***
        configured_catalog = full_refresh_only_catalog(configured_catalog)
>       output = docker_runner.call_read(connector_config, configured_catalog)

/usr/local/lib/python3.9/site-packages/source_acceptance_test/tests/test_full_refresh.py:49: 

It looks like the read fails because of mismatch format on column5, the one under integration_tests/configured_catalog.json is an array of integer. Do you think we need to update the configured catalog for tests?

"column5": {
"type": "array",
"items": {
"type": "integer"
}
}
}
}

Let me know if you have a question. Once the change is made, I will run the tests again. Thanks.

@sajarin
Copy link
Contributor

sajarin commented Oct 20, 2022

@ptiurin can you take a look at the comments above?

@ptiurin
Copy link
Contributor Author

ptiurin commented Oct 21, 2022

Apologies for the delay @sajarin @YiyangLi ,

The catalog and expected records files are correct.
Both of these errors are in fact coming from the database,

"Error executing query:\nThe query could not run because the maximum number of concurrent queries (100) has been exceeded for this engine.

and

Error executing query:\nCannot convert NULL value to non-Nullable type: while executing 'FUNCTION CAST(column5 :: 4, 'Array(Int32)' :: 5) -> CAST(column5, 'Array(Int32)') Array(Int32)

For the first one I'll push a change to get schemas more efficiently. For the second, the fix is on the database side, as it's a bug. I'll let you know once it's fixed in the airbyte FIrebolt account.

@YiyangLi
Copy link
Contributor

YiyangLi commented Oct 21, 2022

/test connector=connectors/source-firebolt

🕑 connectors/source-firebolt https://github.com/airbytehq/airbyte/actions/runs/3300265686
❌ connectors/source-firebolt https://github.com/airbytehq/airbyte/actions/runs/3300265686
🐛 https://gradle.com/s/juvxtrzyijjao

Build Failed

Test summary info:

	 =========================== short test summary info ============================
	 FAILED unit_tests/test_backward_compatibility.py - pydantic.error_wrappers.Va...
	 FAILED unit_tests/test_core.py - pydantic.error_wrappers.ValidationError: 1 v...
	 !!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!
	 
	 Results (1.97s):
	 /actions-runner/_work/airbyte/airbyte/airbyte-integrations/bases/source-acceptance-test/.venv/lib/python3.9/site-packages/coverage/control.py:788: CoverageWarning: No data was collected. (no-data-collected)
	   self._warn("No data was collected.", slug="no-data-collected")

> Task :airbyte-integrations:connectors:source-firebolt:installLocalReqs
	 Collecting cryptography>=3.4.0
	   Using cached cryptography-38.0.1-cp36-abi3-manylinux_2_28_x86_64.whl (4.2 MB)
	 Collecting aiorwlock==1.1.0
	   Downloading aiorwlock-1.1.0-py3-none-any.whl (10.0 kB)
	 Collecting async-property==0.2.1
	   Downloading async_property-0.2.1-py2.py3-none-any.whl (9.4 kB)
	 Collecting appdirs-stubs>=0.1.0
	   Downloading appdirs_stubs-0.1.0-py3-none-any.whl (10 kB)
	 Collecting httpx[http2]==0.23.0
	   Downloading httpx-0.23.0-py3-none-any.whl (84 kB)
	 Collecting httpcore<0.16.0,>=0.15.0
	   Downloading httpcore-0.15.0-py3-none-any.whl (68 kB)
	 Collecting sniffio
	   Downloading sniffio-1.3.0-py3-none-any.whl (10 kB)
	 Collecting rfc3986[idna2008]<2,>=1.3
	   Downloading rfc3986-1.5.0-py2.py3-none-any.whl (31 kB)
	 Collecting certifi
	   Using cached certifi-2022.9.24-py3-none-any.whl (161 kB)
	 Collecting h2<5,>=3
	   Downloading h2-4.1.0-py3-none-any.whl (57 kB)
	 INFO: pip is looking at multiple versions of httpx[http2] to determine which version is compatible with other requirements. This could take a while.
	 INFO: pip is looking at multiple versions of async-property to determine which version is compatible with other requirements. This could take a while.
	 INFO: pip is looking at multiple versions of aiorwlock to determine which version is compatible with other requirements. This could take a while.
	 INFO: pip is looking at multiple versions of firebolt-sdk to determine which version is compatible with other requirements. This could take a while.
	 Collecting firebolt-sdk>=0.8.0
	   Downloading firebolt_sdk-0.10.0-py3-none-any.whl (65 kB)
	 Requirement already satisfied: typing-extensions>=3.7.4.3 in ./.venv/lib/python3.9/site-packages (from pydantic~=1.6->source-acceptance-test==0.0.0->-r requirements.txt (line 2)) (4.4.0)
	   Downloading firebolt_sdk-0.9.2-py3-none-any.whl (63 kB)
	   Downloading firebolt_sdk-0.9.1-py3-none-any.whl (63 kB)
	   Downloading firebolt_sdk-0.9.0-py3-none-any.whl (63 kB)
	   Downloading firebolt_sdk-0.8.1-py3-none-any.whl (62 kB)
	   Downloading firebolt_sdk-0.8.0-py3-none-any.whl (62 kB)
	 Collecting httpx[http2]==0.21.3
	   Downloading httpx-0.21.3-py3-none-any.whl (83 kB)
	 INFO: pip is looking at multiple versions of pydantic to determine which version is compatible with other requirements. This could take a while.
	 INFO: pip is looking at multiple versions of dpath to determine which version is compatible with other requirements. This could take a while.
	 Collecting dpath~=2.0.1
	   Downloading dpath-2.0.5-py3-none-any.whl (15 kB)
	 INFO: pip is looking at multiple versions of firebolt-sdk to determine which version is compatible with other requirements. This could take a while.
	 INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. See https://pip.pypa.io/warnings/backtracking for guidance. If you want to abort this run, press Ctrl + C.
	   Downloading dpath-2.0.4-py3-none-any.whl (15 kB)
	   Downloading dpath-2.0.3-py3-none-any.whl (15 kB)
	   Downloading dpath-2.0.2-py3-none-any.whl (15 kB)
	   Downloading dpath-2.0.1.tar.gz (21 kB)
	   Preparing metadata (setup.py): started
	   Preparing metadata (setup.py): finished with status 'done'
	 INFO: pip is looking at multiple versions of docker to determine which version is compatible with other requirements. This could take a while.
	 INFO: pip is looking at multiple versions of deepdiff to determine which version is compatible with other requirements. This could take a while.
	 Collecting deepdiff~=5.8.0
	   Downloading deepdiff-5.8.0-py3-none-any.whl (69 kB)
	 INFO: pip is looking at multiple versions of dpath to determine which version is compatible with other requirements. This could take a while.
	 INFO: pip is looking at multiple versions of dataclasses-jsonschema to determine which version is compatible with other requirements. This could take a while.
	 INFO: pip is looking at multiple versions of <Python from Requires-Python> to determine which version is compatible with other requirements. This could take a while.
	 INFO: pip is looking at multiple versions of airbyte-cdk to determine which version is compatible with other requirements. This could take a while.
	 Collecting airbyte-cdk~=0.1.56
	   Downloading airbyte_cdk-0.1.103-py3-none-any.whl (241 kB)
	 INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. See https://pip.pypa.io/warnings/backtracking for guidance. If you want to abort this run, press Ctrl + C.
	   Downloading airbyte_cdk-0.1.102-py3-none-any.whl (240 kB)
	   Downloading airbyte_cdk-0.1.101-py3-none-any.whl (240 kB)
	 INFO: pip is looking at multiple versions of docker to determine which version is compatible with other requirements. This could take a while.
	 INFO: pip is looking at multiple versions of deepdiff to determine which version is compatible with other requirements. This could take a while.
	   Downloading airbyte_cdk-0.1.100-py3-none-any.whl (239 kB)
	   Downloading airbyte_cdk-0.1.99-py3-none-any.whl (239 kB)
	 INFO: pip is looking at multiple versions of pydantic to determine which version is compatible with other requirements. This could take a while.
	   Downloading airbyte_cdk-0.1.98-py3-none-any.whl (237 kB)
	 INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. See https://pip.pypa.io/warnings/backtracking for guidance. If you want to abort this run, press Ctrl + C.
	 INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. See https://pip.pypa.io/warnings/backtracking for guidance. If you want to abort this run, press Ctrl + C.
	   Downloading airbyte_cdk-0.1.97-py3-none-any.whl (237 kB)
	 INFO: pip is looking at multiple versions of dataclasses-jsonschema to determine which version is compatible with other requirements. This could take a while.
	 INFO: pip is looking at multiple versions of <Python from Requires-Python> to determine which version is compatible with other requirements. This could take a while.
	 INFO: pip is looking at multiple versions of airbyte-cdk to determine which version is compatible with other requirements. This could take a while.
	   Downloading airbyte_cdk-0.1.96-py3-none-any.whl (237 kB)
	   Downloading airbyte_cdk-0.1.95-py3-none-any.whl (237 kB)
	   Downloading airbyte_cdk-0.1.94-py3-none-any.whl (237 kB)
	 INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. See https://pip.pypa.io/warnings/backtracking for guidance. If you want to abort this run, press Ctrl + C.
	   Downloading airbyte_cdk-0.1.93-py3-none-any.whl (237 kB)
	   Downloading airbyte_cdk-0.1.92-py3-none-any.whl (237 kB)
	 INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. See https://pip.pypa.io/warnings/backtracking for guidance. If you want to abort this run, press Ctrl + C.
	 INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. See https://pip.pypa.io/warnings/backtracking for guidance. If you want to abort this run, press Ctrl + C.
	 INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. See https://pip.pypa.io/warnings/backtracking for guidance. If you want to abort this run, press Ctrl + C.
	   Downloading airbyte_cdk-0.1.91-py3-none-any.whl (236 kB)
	   Downloading airbyte_cdk-0.1.90-py3-none-any.whl (236 kB)
	   Downloading airbyte_cdk-0.1.89-py3-none-any.whl (236 kB)
	   Downloading airbyte_cdk-0.1.88-py3-none-any.whl (236 kB)
	   Downloading airbyte_cdk-0.1.87-py3-none-any.whl (236 kB)
	   Downloading airbyte_cdk-0.1.86-py3-none-any.whl (231 kB)
	   Downloading airbyte_cdk-0.1.85-py3-none-any.whl (231 kB)
	   Downloading airbyte_cdk-0.1.84-py3-none-any.whl (230 kB)
	   Downloading airbyte_cdk-0.1.83-py3-none-any.whl (230 kB)
	   Downloading airbyte_cdk-0.1.82-py3-none-any.whl (230 kB)
	   Downloading airbyte_cdk-0.1.81-py3-none-any.whl (227 kB)
	 Collecting dataclasses-jsonschema~=2.15.1
	   Downloading dataclasses_jsonschema-2.15.3-py3-none-any.whl (18 kB)
	 Collecting airbyte-cdk~=0.1.56
	   Downloading airbyte_cdk-0.1.80-py3-none-any.whl (227 kB)
	 Collecting python-dotenv>=0.10.4
	   Downloading python_dotenv-0.21.0-py3-none-any.whl (18 kB)
	 Requirement already satisfied: attrs>=19.2.0 in ./.venv/lib/python3.9/site-packages (from hypothesis~=6.54.1->source-acceptance-test==0.0.0->-r requirements.txt (line 2)) (22.1.0)
	 Collecting sortedcontainers<3.0.0,>=2.1.0
	   Using cached sortedcontainers-2.4.0-py2.py3-none-any.whl (29 kB)
	 Collecting exceptiongroup>=1.0.0rc8
	   Using cached exceptiongroup-1.0.0rc9-py3-none-any.whl (12 kB)
	 Collecting six>=1.11.0
	   Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
	 Requirement already satisfied: setuptools in ./.venv/lib/python3.9/site-packages (from jsonschema~=3.2.0->source-acceptance-test==0.0.0->-r requirements.txt (line 2)) (65.5.0)
	 Collecting pyrsistent>=0.14.0
	   Using cached pyrsistent-0.18.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (115 kB)
	 Collecting pygments
	   Using cached Pygments-2.13.0-py3-none-any.whl (1.1 MB)
	 Collecting wmctrl
	   Using cached wmctrl-0.4-py3-none-any.whl
	 Collecting fancycompleter>=0.8
	   Using cached fancycompleter-0.9.1-py3-none-any.whl (9.7 kB)
	 Requirement already satisfied: packaging in ./.venv/lib/python3.9/site-packages (from pytest~=6.1->source-acceptance-test==0.0.0->-r requirements.txt (line 2)) (21.3)
	 Requirement already satisfied: pluggy<1.0,>=0.12 in ./.venv/lib/python3.9/site-packages (from pytest~=6.1->source-acceptance-test==0.0.0->-r requirements.txt (line 2)) (0.13.1)
	 Requirement already satisfied: toml in ./.venv/lib/python3.9/site-packages (from pytest~=6.1->source-acceptance-test==0.0.0->-r requirements.txt (line 2)) (0.10.2)
	 Requirement already satisfied: iniconfig in ./.venv/lib/python3.9/site-packages (from pytest~=6.1->source-acceptance-test==0.0.0->-r requirements.txt (line 2)) (1.1.1)
	 Requirement already satisfied: py>=1.8.2 in ./.venv/lib/python3.9/site-packages (from pytest~=6.1->source-acceptance-test==0.0.0->-r requirements.txt (line 2)) (1.11.0)
	 Requirement already satisfied: coverage[toml]>=5.2.1 in ./.venv/lib/python3.9/site-packages (from pytest-cov~=3.0.0->source-acceptance-test==0.0.0->-r requirements.txt (line 2)) (6.3.1)
	 Collecting termcolor>=1.1.0
	   Using cached termcolor-2.0.1-py3-none-any.whl (5.4 kB)
	 Requirement already satisfied: tomli in ./.venv/lib/python3.9/site-packages (from coverage[toml]>=5.2.1->pytest-cov~=3.0.0->source-acceptance-test==0.0.0->-r requirements.txt (line 2)) (2.0.1)
	 Collecting cffi>=1.12
	   Using cached cffi-1.15.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (441 kB)
	 Collecting wrapt<2,>=1.10
	   Using cached wrapt-1.14.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (77 kB)
	 Collecting pyrepl>=0.8.2
	   Using cached pyrepl-0.9.0-py3-none-any.whl
	 Collecting MarkupSafe>=2.0
	   Using cached MarkupSafe-2.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)
	 Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in ./.venv/lib/python3.9/site-packages (from packaging->pytest~=6.1->source-acceptance-test==0.0.0->-r requirements.txt (line 2)) (3.0.9)
	 Collecting idna<4,>=2.5
	   Using cached idna-3.4-py3-none-any.whl (61 kB)
	 Collecting charset-normalizer<3,>=2
	   Using cached charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
	 Collecting urllib3<1.27,>=1.21.1
	   Using cached urllib3-1.26.12-py2.py3-none-any.whl (140 kB)
	 Collecting pytzdata>=2020.1
	   Using cached pytzdata-2020.1-py2.py3-none-any.whl (489 kB)
	 Collecting yarl
	   Using cached yarl-1.8.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (264 kB)
	 Collecting pycparser
	   Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
	 Collecting hpack<5,>=4.0
	   Downloading hpack-4.0.0-py3-none-any.whl (32 kB)
	 Collecting hyperframe<7,>=6.0
	   Downloading hyperframe-6.0.1-py3-none-any.whl (12 kB)
	 Collecting anyio==3.*
	   Downloading anyio-3.6.2-py3-none-any.whl (80 kB)
	 Collecting h11<0.13,>=0.11
	   Downloading h11-0.12.0-py3-none-any.whl (54 kB)
	 Collecting multidict>=4.0
	   Using cached multidict-6.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (114 kB)
	 Installing collected packages: sniffio, idna, rfc3986, h11, certifi, anyio, six, pyrsistent, pycparser, multidict, hyperframe, httpcore, hpack, yarl, wrapt, urllib3, sortedcontainers, PyYAML, pytzdata, python-dotenv, python-dateutil, pyrepl, pydantic, MarkupSafe, jsonschema, httpx, h2, exceptiongroup, charset-normalizer, cffi, appdirs, wmctrl, websocket-client, vcrpy, termcolor, sqlparse, requests, readerwriterlock, pygments, pendulum, ordered-set, jsonref, Jinja2, hypothesis, fancycompleter, dpath, Deprecated, dataclasses-jsonschema, cryptography, backoff, async-property, appdirs-stubs, aiorwlock, requests-mock, pytest-timeout, pytest-sugar, pytest-mock, pytest-cov, pprintpp, pdbpp, inflection, icdiff, hypothesis-jsonschema, firebolt-sdk, docker, deepdiff, airbyte-cdk, source-firebolt, source-acceptance-test
	   Running setup.py develop for source-firebolt
	   Running setup.py develop for source-acceptance-test
	 Successfully installed Deprecated-1.2.13 Jinja2-3.1.2 MarkupSafe-2.1.1 PyYAML-5.4.1 aiorwlock-1.1.0 airbyte-cdk-0.1.80 anyio-3.6.2 appdirs-1.4.4 appdirs-stubs-0.1.0 async-property-0.2.1 backoff-2.2.1 certifi-2022.9.24 cffi-1.15.1 charset-normalizer-2.1.1 cryptography-38.0.1 dataclasses-jsonschema-2.15.3 deepdiff-5.8.1 docker-5.0.3 dpath-2.0.6 exceptiongroup-1.0.0rc9 fancycompleter-0.9.1 firebolt-sdk-0.11.0 h11-0.12.0 h2-4.1.0 hpack-4.0.0 httpcore-0.15.0 httpx-0.23.0 hyperframe-6.0.1 hypothesis-6.54.6 hypothesis-jsonschema-0.20.1 icdiff-1.9.1 idna-3.4 inflection-0.5.1 jsonref-0.2 jsonschema-3.2.0 multidict-6.0.2 ordered-set-4.1.0 pdbpp-0.10.3 pendulum-2.1.2 pprintpp-0.4.0 pycparser-2.21 pydantic-1.8.2 pygments-2.13.0 pyrepl-0.9.0 pyrsistent-0.18.1 pytest-cov-3.0.0 pytest-mock-3.6.1 pytest-sugar-0.9.5 pytest-timeout-1.4.2 python-dateutil-2.8.2 python-dotenv-0.21.0 pytzdata-2020.1 readerwriterlock-1.0.9 requests-2.28.1 requests-mock-1.9.3 rfc3986-1.5.0 six-1.16.0 sniffio-1.3.0 sortedcontainers-2.4.0 source-acceptance-test-0.0.0 source-firebolt-0.0.0 sqlparse-0.4.3 termcolor-2.0.1 urllib3-1.26.12 vcrpy-4.2.1 websocket-client-1.4.1 wmctrl-0.4 wrapt-1.14.1 yarl-1.8.1
	 WARNING: You are using pip version 21.3.1; however, version 22.3 is available.
	 You should consider upgrading via the '/actions-runner/_work/airbyte/airbyte/airbyte-integrations/connectors/source-firebolt/.venv/bin/python -m pip install --upgrade pip' command.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.4/userguide/command_line_interface.html#sec:command_line_warnings
39 actionable tasks: 26 executed, 13 up-to-date

Publishing build scan...
https://gradle.com/s/juvxtrzyijjao

@ptiurin
Copy link
Contributor Author

ptiurin commented Oct 31, 2022

@YiyangLi your Firebolt account is updated now. I've also rebased the branch on master. The tests are succeeding locally, could you re-run the acceptance tests?

@YiyangLi
Copy link
Contributor

YiyangLi commented Oct 31, 2022

/test connector=connectors/source-firebolt

🕑 connectors/source-firebolt https://github.com/airbytehq/airbyte/actions/runs/3362943630
❌ connectors/source-firebolt https://github.com/airbytehq/airbyte/actions/runs/3362943630
🐛 https://gradle.com/s/4246bfdei5kpm

Build Failed

Test summary info:

Could not find result summary

Copy link
Contributor

@YiyangLi YiyangLi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, but waiting for CI to get the acceptance test pass

@YiyangLi
Copy link
Contributor

@ptiurin I can't help you rebase the branch. Can you either grant me access or rebase it yourself?

@YiyangLi
Copy link
Contributor

@ptiurin

The test in CI fails because of a dependency conflict.

The conflict is caused by:
	     source-acceptance-test 0.0.0 depends on pydantic~=1.6
	     airbyte-cdk 0.2.0 depends on pydantic~=1.9.2
	     pydantic[dotenv] 1.8.2 depends on pydantic 1.8.2 (from https://files.pythonhosted.org/packages/d8/a3/b03397aca3de5aa7e1353c2bd2c9753c7a7ce5e001b3a5b2da98c6bdde13/pydantic-1.8.2-cp39-cp39-manylinux2014_x86_64.whl#sha256=54cd5121383f4a461ff7644c7ca20c0419d58052db70d8791eacbbe31528916b (from https://pypi.org/simple/pydantic/) (requires-python:>=3.6.1))
	 
	 To fix this you could try to:
	 1. loosen the r

I can't push a commit for you, see if the following suggestion works:

 from setuptools import find_packages, setup
 
-MAIN_REQUIREMENTS = ["airbyte-cdk", "firebolt-sdk>=0.8.0"]
+MAIN_REQUIREMENTS = [
+    "airbyte-cdk~=-0.2",
+    "firebolt-sdk>=0.8.0",
+]
 
 TEST_REQUIREMENTS = [
     "pytest>=6.2.5",  # 6.2.5 has python10 compatibility fixes

Thanks.

@ptiurin
Copy link
Contributor Author

ptiurin commented Oct 31, 2022

Thanks @YiyangLi , I've added your suggestion. I've also granted you write access so you can experiment if it doesn't work.

@YiyangLi
Copy link
Contributor

YiyangLi commented Nov 4, 2022

/test connector=connectors/source-firebolt

🕑 connectors/source-firebolt https://github.com/airbytehq/airbyte/actions/runs/3397196104
❌ connectors/source-firebolt https://github.com/airbytehq/airbyte/actions/runs/3397196104
🐛 https://gradle.com/s/uqewsaz56jmsw

Build Failed

Test summary info:

=========================== short test summary info ============================
FAILED test_core.py::TestBasicRead::test_read[inputs0] - docker.errors.Contai...
ERROR test_core.py::TestDiscovery::test_backward_compatibility[inputs0] - doc...
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:63: Skipping TestIncremental.test_two_sequential_reads: not found in the config.
======== 1 failed, 24 passed, 1 skipped, 27 warnings, 1 error in 46.35s ========

@YiyangLi
Copy link
Contributor

YiyangLi commented Nov 6, 2022

/test connector=connectors/source-firebolt

🕑 connectors/source-firebolt https://github.com/airbytehq/airbyte/actions/runs/3405142431
❌ connectors/source-firebolt https://github.com/airbytehq/airbyte/actions/runs/3405142431
🐛 https://gradle.com/s/grggod3w6j6ny

Build Failed

Test summary info:

=========================== short test summary info ============================
FAILED test_core.py::TestBasicRead::test_read[inputs0] - docker.errors.Contai...
FAILED test_full_refresh.py::TestFullRefresh::test_sequential_reads[inputs0]
ERROR test_core.py::TestDiscovery::test_backward_compatibility[inputs0] - doc...
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:63: Skipping TestIncremental.test_two_sequential_reads: not found in the config.
======== 2 failed, 23 passed, 1 skipped, 27 warnings, 1 error in 37.11s ========

@YiyangLi
Copy link
Contributor

YiyangLi commented Nov 6, 2022

@ptiurin Can you advise how to address the rate limit issue when CI runs the test?

2 tests fail, and the reason is the same -- 429 too many requests.

I didn't run the tests too frequently, I didn't run it yesterday, and I run it once today, I assume the quota is recharged.

The CDK offers a retry if get_back_off_time is implemented (example). If the retry is not feasible, can we increase the quota on the test account or lower the size of the data being fetched in order to get the test passed? Thanks.

FAILED test_core.py::TestBasicRead::test_read[inputs0] - docker.errors.Contai...
FAILED test_full_refresh.py::TestFullRefresh::test_sequential_reads[inputs0]
***"type": "LOG", "log": ***"level": "ERROR", "message": "Docker container failed, code 1, error:\n***\"type\": \"TRACE\", \"trace\": ***\"type\": \"ERROR\", \"emitted_at\": 1667753387987.272, \"error\": ***\"message\": \"Something went wrong in the connector. See the logs for more details.\", \"internal_message\": \"Client error '429 Too Many Requests' for url 'https://airbyte-acceptance-tests-general-purpose-1.airbyte.us-east-1.app.firebolt.io/?database=airbyte_acceptance_tests&output_format=JSONCompact'\\nFor more information check: [https://httpstatuses.com/429\](https://httpstatuses.com/429/)", \"stack_trace\": \"Traceback (most recent call last):\\n  File \\\"/airbyte/integration_code/main.py\\\", line 13, in <module>\\n    launch(source, sys.argv[1:])\\n  File \\\"/usr/local/lib/python3.9/site-packages/airbyte_cdk/entrypoint.py\\\", line 131, in launch\\n    for message in source_entrypoint.run(parsed_args):\\n  File \\\"/usr/local/lib/python3.9/site-packages/airbyte_cdk/entrypoint.py\\\", line 122, in run\\n    for message in generator:\\n  File \\\"/airbyte/integration_code/source_firebolt/source.py\\\", line 119, in read\\n    cursor.execute(query)\\n  File \\\"/usr/local/lib/python3.9/site-packages/firebolt/db/cursor.py\\\", line 55, in execute\\n    return async_to_sync(super().execute, self._async_job_thread)(\\n  File \\\"/usr/local/lib/python3.9/site-packages/firebolt/utils/util.py\\\", line 180, in sync\\n    return loop.run_until_complete(f(*args, **kwargs))\\n  File \\\"/usr/local/lib/python3.9/asyncio/base_events.py\\\", line 647, in run_until_complete\\n    return future.result()\\n  File \\\"/usr/local/lib/python3.9/site-packages/firebolt/async_db/cursor.py\\\", line 523, in execute\\n    await self._do_execute(query, params_list, skip_parsing, async_execution)\\n  File \\\"/usr/local/lib/python3.9/site-packages/firebolt/async_db/cursor.py\\\", line 471, in _do_execute\\n    await self._raise_if_error(resp)\\n  File \\\"/usr/local/lib/python3.9/site-packages/firebolt/async_db/cursor.py\\\", line 275, in _raise_if_error\\n    resp.raise_for_status()\\n  File \\\"/usr/local/lib/python3.9/site-packages/httpx/_models.py\\\", line 736, in raise_for_status\\n    raise HTTPStatusError(message, request=request, response=self)\\nhttpx.HTTPStatusError: Client error '429 Too Many Requests' for url 'https://airbyte-acceptance-tests-general-purpose-1.airbyte.us-east-1.app.firebolt.io/?database=airbyte_acceptance_tests&output_format=JSONCompact'\\nFor more information check: [https://httpstatuses.com/429\\n\](https://httpstatuses.com/429//n/)", \"failure_type\": \"system_error\"***\n"***

@YiyangLi
Copy link
Contributor

YiyangLi commented Nov 9, 2022

/test connector=connectors/source-firebolt

🕑 connectors/source-firebolt https://github.com/airbytehq/airbyte/actions/runs/3431997764
❌ connectors/source-firebolt https://github.com/airbytehq/airbyte/actions/runs/3431997764
🐛 https://gradle.com/s/emfe4bcmztqhm

Build Failed

Test summary info:

=========================== short test summary info ============================
FAILED test_core.py::TestBasicRead::test_read[inputs0] - docker.errors.Contai...
ERROR test_core.py::TestDiscovery::test_backward_compatibility[inputs0] - doc...
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:63: Skipping TestIncremental.test_two_sequential_reads: not found in the config.
======== 1 failed, 24 passed, 1 skipped, 27 warnings, 1 error in 43.31s ========

@ptiurin
Copy link
Contributor Author

ptiurin commented Nov 10, 2022

@YiyangLi Looking at the logs, it's running the old version of code, which did individual calls per table. (If you search for SHOW COLUMNS in the logs, that's the code that's been deleted in this PR). Is there some sort of caching? Maybe a way to rebuild a docker image to pick up the latest code from this PR?
I've noticed the same issue locally, so I had to rebuild the image with --no-cache option.

@YiyangLi
Copy link
Contributor

YiyangLi commented Nov 10, 2022

/test connector=connectors/source-firebolt

🕑 connectors/source-firebolt https://github.com/airbytehq/airbyte/actions/runs/3439946289
❌ connectors/source-firebolt https://github.com/airbytehq/airbyte/actions/runs/3439946289
🐛 https://gradle.com/s/3rs433qtqxld2

Build Failed

Test summary info:

=========================== short test summary info ============================
FAILED test_core.py::TestBasicRead::test_read[inputs0] - docker.errors.Contai...
ERROR test_core.py::TestDiscovery::test_backward_compatibility[inputs0] - doc...
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:63: Skipping TestIncremental.test_two_sequential_reads: not found in the config.
======== 1 failed, 25 passed, 1 skipped, 28 warnings, 1 error in 46.63s ========

@YiyangLi
Copy link
Contributor

YiyangLi commented Nov 13, 2022

@ptiurin I rebuilt the docker image in my local environment, with the flag of --no-cache, the problem still persists. I also clean up all unused images and built again. I got the same error. Is it related to the account setting? The integration account has limited quotas in API and consequently hit the rate limit?

Build the image

(.venv) > docker image rm ab7582f1ade6
Untagged: airbyte/source-firebolt:dev
Deleted: sha256:ab7582f1ade6620eb9eb541cb1df89576dd585e3871f50843dc674664bc89dee
(.venv) > docker images airbyte/source-firebolt
REPOSITORY   TAG       IMAGE ID   CREATED   SIZE
(.venv) > docker build . --no-cache -t airbyte/source-firebolt:dev  
[+] Building 24.4s (17/17) FINISHED                                                                                                                                                                                                                                             
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                       0.0s
 => => transferring dockerfile: 37B                                                                                                                                                                                                                                        0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                                                          0.0s
 => => transferring context: 34B                                                                                                                                                                                                                                           0.0s
 => [internal] load metadata for docker.io/library/python:3.9.11-alpine3.15                                                                                                                                                                                                0.9s
 => [base 1/1] FROM docker.io/library/python:3.9.11-alpine3.15@sha256:45ddd216e6b4efee0617e15d541e9148ffd6898203fcbe86a9f5bf906ce7837f                                                                                                                                     0.0s
 => [internal] load build context                                                                                                                                                                                                                                          0.0s
 => => transferring context: 646B                                                                                                                                                                                                                                          0.0s
 => CACHED [stage-2 1/7] WORKDIR /airbyte/integration_code                                                                                                                                                                                                                 0.0s
 => [builder 2/5] RUN apk --no-cache upgrade     && pip install --upgrade pip     && apk --no-cache add tzdata build-base                                                                                                                                                  5.7s
 => [builder 3/5] RUN apk add libffi-dev                                                                                                                                                                                                                                   0.6s 
 => [builder 4/5] COPY setup.py ./                                                                                                                                                                                                                                         0.0s 
 => [builder 5/5] RUN pip install --prefix=/install .                                                                                                                                                                                                                     14.9s 
 => [stage-2 2/7] COPY --from=builder /install /usr/local                                                                                                                                                                                                                  0.3s 
 => [stage-2 3/7] COPY --from=builder /usr/share/zoneinfo/Etc/UTC /etc/localtime                                                                                                                                                                                           0.0s 
 => [stage-2 4/7] RUN echo "Etc/UTC" > /etc/timezone                                                                                                                                                                                                                       0.2s 
 => [stage-2 5/7] RUN apk --no-cache add bash                                                                                                                                                                                                                              0.9s 
 => [stage-2 6/7] COPY main.py ./                                                                                                                                                                                                                                          0.0s 
 => [stage-2 7/7] COPY source_firebolt ./source_firebolt                                                                                                                                                                                                                   0.0s 
 => exporting to image                                                                                                                                                                                                                                                     0.4s 
 => => exporting layers                                                                                                                                                                                                                                                    0.4s 
 => => writing image sha256:375411b24b1656f195e0a55f93935f6c0b8c0408addb50235775e2856d4ae4bc                                                                                                                                                                               0.0s
 => => naming to docker.io/airbyte/source-firebolt:dev                                                                                                                                                                                                                     0.0s

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them

Errors

Results (47.10s):
      24 passed
       2 failed
         - airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py:537 TestBasicRead.test_read[inputs0]
         - airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_full_refresh.py:39 TestFullRefresh.test_sequential_reads[inputs0]
       1 error

Details

docker.errors.ContainerError: Command 'read --config /data/tap_config.json --catalog /data/catalog.json' in image '<Image: 'airbyte/source-firebolt:dev'>' returned non-zero exit status 1: {"type": "TRACE", "trace": {"type": "ERROR", "emitted_at": 1668367756030.345, "error": {"message": "Something went wrong in the connector. See the logs for more details.", "internal_message": "Client error '429 Too Many Requests' for url 'https://airbyte-acceptance-tests-general-purpose-1.airbyte.us-east-1.app.firebolt.io/?database=airbyte_acceptance_tests&output_format=JSONCompact'\nFor more information check: https://httpstatuses.com/429", "stack_trace": "Traceback (most recent call last):\n  File \"/airbyte/integration_code/main.py\", line 13, in <module>\n    launch(source, sys.argv[1:])\n  File \"/usr/local/lib/python3.9/site-packages/airbyte_cdk/entrypoint.py\", line 131, in launch\n    for message in source_entrypoint.run(parsed_args):\n  File \"/usr/local/lib/python3.9/site-packages/airbyte_cdk/entrypoint.py\", line 122, in run\n    for message in generator:\n  File \"/airbyte/integration_code/source_firebolt/source.py\", line 119, in read\n    cursor.execute(query)\n  File \"/usr/local/lib/python3.9/site-packages/firebolt/db/cursor.py\", line 55, in execute\n    return async_to_sync(super().execute, self._async_job_thread)(\n  File \"/usr/local/lib/python3.9/site-packages/firebolt/utils/util.py\", line 180, in sync\n    return loop.run_until_complete(f(*args, **kwargs))\n  File \"/usr/local/lib/python3.9/asyncio/base_events.py\", line 647, in run_until_complete\n    return future.result()\n  File \"/usr/local/lib/python3.9/site-packages/firebolt/async_db/cursor.py\", line 523, in execute\n    await self._do_execute(query, params_list, skip_parsing, async_execution)\n  File \"/usr/local/lib/python3.9/site-packages/firebolt/async_db/cursor.py\", line 471, in _do_execute\n    await self._raise_if_error(resp)\n  File \"/usr/local/lib/python3.9/site-packages/firebolt/async_db/cursor.py\", line 275, in _raise_if_error\n    resp.raise_for_status()\n  File \"/usr/local/lib/python3.9/site-packages/httpx/_models.py\", line 736, in raise_for_status\n    raise HTTPStatusError(message, request=request, response=self)\nhttpx.HTTPStatusError: Client error '429 Too Many Requests' for url 'https://airbyte-acceptance-tests-general-purpose-1.airbyte.us-east-1.app.firebolt.io/?database=airbyte_acceptance_tests&output_format=JSONCompact'\nFor more information check: https://httpstatuses.com/429\n", "failure_type": "system_error"}}}

This is the same error in CI, I think CI builds an image from the scratch everytime it runs the test.

@ptiurin
Copy link
Contributor Author

ptiurin commented Nov 14, 2022

@YiyangLi I think I finally understand where the error is coming from. Backwards compatibility test runs both new and old image to compare them. The old image contains the old code, which queries the structure of each table one-by-one. Airbyte database contains a large number of tables so this overwhelms the API with many simultaneous requests. The new image contains updated code that fetches structures of any number of tables in one go, so this issue does not occur.
I was confused seeing the old code in the logs. I've now added disable_for_version: "0.1.0" in the acceptance configuration which should skip this test for the time being so the old image won't be running.

@YiyangLi
Copy link
Contributor

YiyangLi commented Nov 14, 2022

@YiyangLi I think I finally understand where the error is coming from. Backwards compatibility test runs both new and old image to compare them. The old image contains the old code, which queries the structure of each table one-by-one. Airbyte database contains a large number of tables so this overwhelms the API with many simultaneous requests. The new image contains updated code that fetches structures of any number of tables in one go, so this issue does not occur. I was confused seeing the old code in the logs. I've now added disable_for_version: "0.1.0" in the acceptance configuration which should skip this test for the time being so the old image won't be running.

@sajarin Can you ask around to see if these tables are used? If not, can I drop these tables?

The following screenshot says, 661 out of 708 tables contain "_airbyte_raw".

Screenshot 2022-11-14 at 11 24 15 AM

Screenshot 2022-11-14 at 11 28 24 AM

According to the configured_catalog.json, only 1 table is read for the integration test. But before that, the connector will run the following query to get all available tables and columns, which throws 429 too many requests error in the CI test. I want confirm with the airbyte team. If it's safe to drop these tables, we can get the CI test pass.

SELECT table_name, column_name, data_type, is_nullable FROM information_schema.columns 
WHERE table_name NOT IN (
  SELECT table_name FROM information_schema.tables WHERE table_type IN ('EXTERNAL', 'CATALOG')
)

@YiyangLi
Copy link
Contributor

YiyangLi commented Nov 18, 2022

/test connector=connectors/source-firebolt

🕑 connectors/source-firebolt https://github.com/airbytehq/airbyte/actions/runs/3494786390
✅ connectors/source-firebolt https://github.com/airbytehq/airbyte/actions/runs/3494786390
Python tests coverage:

Name                          Stmts   Miss  Cover
-------------------------------------------------
source_firebolt/source.py        44      0   100%
source_firebolt/__init__.py       2      0   100%
source_firebolt/utils.py         34      1    97%
source_firebolt/database.py      36      5    86%
-------------------------------------------------
TOTAL                           116      6    95%
Name                          Stmts   Miss  Cover
-------------------------------------------------
source_firebolt/utils.py         34      0   100%
source_firebolt/__init__.py       2      0   100%
source_firebolt/source.py        44      1    98%
source_firebolt/database.py      36      4    89%
-------------------------------------------------
TOTAL                           116      5    96%
	 Name                                                 Stmts   Miss  Cover   Missing
	 ----------------------------------------------------------------------------------
	 source_acceptance_test/base.py                          12      4    67%   16-19
	 source_acceptance_test/config.py                       139      5    96%   87, 93, 235, 239-240
	 source_acceptance_test/conftest.py                     196     92    53%   35, 41-43, 48, 54, 60, 66, 72-74, 93, 98-100, 106-108, 114-115, 120-121, 126, 132, 141-150, 156-161, 176, 200, 231, 237, 243-248, 256-261, 269-282, 287-293, 300-311, 318-334
	 source_acceptance_test/plugin.py                        69     25    64%   22-23, 31, 36, 120-140, 144-148
	 source_acceptance_test/tests/test_core.py              353    110    69%   53, 64-72, 77-84, 88-89, 93-94, 192, 230-247, 256-264, 268-273, 279, 312-317, 355-362, 405-407, 410, 475-483, 495-498, 503, 559-560, 566, 569, 605-615, 628-653
	 source_acceptance_test/tests/test_incremental.py       158     14    91%   52-59, 64-77, 240
	 source_acceptance_test/utils/asserts.py                 37      2    95%   57-58
	 source_acceptance_test/utils/common.py                  94     10    89%   16-17, 32-38, 72, 75
	 source_acceptance_test/utils/compare.py                 62     23    63%   21-51, 68, 97-99
	 source_acceptance_test/utils/connector_runner.py       112     50    55%   23-26, 32, 36, 39-68, 71-73, 76-78, 81-83, 86-88, 91-93, 96-114, 148-150
	 source_acceptance_test/utils/json_schema_helper.py     105     13    88%   30-31, 38, 41, 65-68, 96, 120, 190-192
	 ----------------------------------------------------------------------------------
	 TOTAL                                                 1516    348    77%

Build Passed

Test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:63: Skipping TestIncremental.test_two_sequential_reads: not found in the config.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/tests/test_core.py:263: Backward compatibility tests are disabled for version 0.1.0.
================= 26 passed, 2 skipped, 28 warnings in 38.83s ==================

@YiyangLi
Copy link
Contributor

YiyangLi commented Nov 18, 2022

/test connector=connectors/source-firebolt

🕑 connectors/source-firebolt https://github.com/airbytehq/airbyte/actions/runs/3494892279
✅ connectors/source-firebolt https://github.com/airbytehq/airbyte/actions/runs/3494892279
Python tests coverage:

Name                          Stmts   Miss  Cover
-------------------------------------------------
source_firebolt/source.py        44      0   100%
source_firebolt/__init__.py       2      0   100%
source_firebolt/utils.py         34      1    97%
source_firebolt/database.py      36      5    86%
-------------------------------------------------
TOTAL                           116      6    95%
Name                          Stmts   Miss  Cover
-------------------------------------------------
source_firebolt/utils.py         34      0   100%
source_firebolt/__init__.py       2      0   100%
source_firebolt/source.py        44      1    98%
source_firebolt/database.py      36      4    89%
-------------------------------------------------
TOTAL                           116      5    96%
	 Name                                                 Stmts   Miss  Cover   Missing
	 ----------------------------------------------------------------------------------
	 source_acceptance_test/base.py                          12      4    67%   16-19
	 source_acceptance_test/config.py                       139      5    96%   87, 93, 235, 239-240
	 source_acceptance_test/conftest.py                     196     92    53%   35, 41-43, 48, 54, 60, 66, 72-74, 93, 98-100, 106-108, 114-115, 120-121, 126, 132, 141-150, 156-161, 176, 200, 231, 237, 243-248, 256-261, 269-282, 287-293, 300-311, 318-334
	 source_acceptance_test/plugin.py                        69     25    64%   22-23, 31, 36, 120-140, 144-148
	 source_acceptance_test/tests/test_core.py              398    111    72%   53, 58, 87-95, 100-107, 111-112, 116-117, 299, 337-354, 363-371, 375-380, 386, 419-424, 462-469, 512-514, 517, 582-590, 602-605, 610, 666-667, 673, 676, 712-722, 735-760
	 source_acceptance_test/tests/test_incremental.py       158     14    91%   52-59, 64-77, 240
	 source_acceptance_test/utils/asserts.py                 37      2    95%   57-58
	 source_acceptance_test/utils/common.py                  94     10    89%   16-17, 32-38, 72, 75
	 source_acceptance_test/utils/compare.py                 62     23    63%   21-51, 68, 97-99
	 source_acceptance_test/utils/connector_runner.py       112     50    55%   23-26, 32, 36, 39-68, 71-73, 76-78, 81-83, 86-88, 91-93, 96-114, 148-150
	 source_acceptance_test/utils/json_schema_helper.py     107     13    88%   30-31, 38, 41, 65-68, 96, 120, 192-194
	 ----------------------------------------------------------------------------------
	 TOTAL                                                 1563    349    78%

Build Passed

Test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:63: Skipping TestIncremental.test_two_sequential_reads: not found in the config.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/tests/test_core.py:370: Backward compatibility tests are disabled for version 0.1.0.
================= 27 passed, 2 skipped, 29 warnings in 31.54s ==================

@YiyangLi
Copy link
Contributor

YiyangLi commented Nov 18, 2022

/publish connector=connectors/source-firebolt

🕑 Publishing the following connectors:
connectors/source-firebolt
https://github.com/airbytehq/airbyte/actions/runs/3499289290


Connector Did it publish? Were definitions generated?
connectors/source-firebolt

if you have connectors that successfully published but failed definition generation, follow step 4 here ▶️

@marcosmarxm
Copy link
Member

@ptiurin and @YiyangLi this week because of Thanksgiving holiday Airbyte blocked merging code to main branch. I'll merge it next week.

@marcosmarxm
Copy link
Member

Hello 👋, first thank you for this amazing contribution.

We really appreciate the effort you've made to improve the project.
We ask you patience for the code review. Last month our team was focused on Hacktoberfest event and that probably left some PR without the proper feedback. And this week, due to the Thanksgiving US Holiday, most our team is out of office with their families. Another important piece of information why code won't be merge this week is: as a safety measure the core team has decided to freeze merging code to main branch to keep the release stable. Next week we'll return to you with the proper code review and update the status of your contribution.

If you have any questions feel free to send me a message in Slack!
Thanks!

Copy link
Member

@marcosmarxm marcosmarxm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@YiyangLi it is missing the seed file generation. Check this step here: https://docs.airbyte.com/connector-development/#publishing-a-connector

@@ -25,7 +25,7 @@ repos:
]
additional_dependencies: ["colorama"]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.5.0
rev: v3.0.0-alpha.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@YiyangLi this files don't belong to this change. Please revert this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, reverted.

Copy link
Member

@marcosmarxm marcosmarxm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments.

| 0.2.0 | 2022-09-09 | TBD | Reading from views |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update this too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, updated the doc. I am going to run test again. Can you help remove the docker image before I run the publish?

- revert .pre-commit-config.yaml
- update versions manually under the seed file
- update the doc to reflect the PR link
@YiyangLi
Copy link
Contributor

YiyangLi commented Dec 1, 2022

/test connector=connectors/source-firebolt

🕑 connectors/source-firebolt https://github.com/airbytehq/airbyte/actions/runs/3594185204
✅ connectors/source-firebolt https://github.com/airbytehq/airbyte/actions/runs/3594185204
Python tests coverage:

Name                          Stmts   Miss  Cover
-------------------------------------------------
source_firebolt/source.py        44      0   100%
source_firebolt/__init__.py       2      0   100%
source_firebolt/utils.py         34      1    97%
source_firebolt/database.py      36      5    86%
-------------------------------------------------
TOTAL                           116      6    95%
Name                          Stmts   Miss  Cover
-------------------------------------------------
source_firebolt/utils.py         34      0   100%
source_firebolt/__init__.py       2      0   100%
source_firebolt/source.py        44      1    98%
source_firebolt/database.py      36      4    89%
-------------------------------------------------
TOTAL                           116      5    96%
	 Name                                                 Stmts   Miss  Cover   Missing
	 ----------------------------------------------------------------------------------
	 source_acceptance_test/base.py                          12      4    67%   16-19
	 source_acceptance_test/config.py                       140      5    96%   87, 93, 238, 242-243
	 source_acceptance_test/conftest.py                     199     93    53%   35, 41-43, 48, 53, 59, 65, 71, 77-79, 98, 103-105, 111-113, 119-120, 125-126, 131, 137, 146-155, 161-166, 181, 205, 236, 242, 250-255, 263-268, 276-289, 294-300, 307-318, 325-341
	 source_acceptance_test/plugin.py                        69     25    64%   22-23, 31, 36, 120-140, 144-148
	 source_acceptance_test/tests/test_core.py              398    111    72%   53, 58, 87-95, 100-107, 111-112, 116-117, 299, 337-354, 363-371, 375-380, 386, 419-424, 462-469, 512-514, 517, 582-590, 602-605, 610, 666-667, 673, 676, 712-722, 735-760
	 source_acceptance_test/tests/test_incremental.py       158     14    91%   52-59, 64-77, 240
	 source_acceptance_test/utils/asserts.py                 39      2    95%   62-63
	 source_acceptance_test/utils/common.py                  94     10    89%   16-17, 32-38, 72, 75
	 source_acceptance_test/utils/compare.py                 62     23    63%   21-51, 68, 97-99
	 source_acceptance_test/utils/connector_runner.py       112     50    55%   23-26, 32, 36, 39-68, 71-73, 76-78, 81-83, 86-88, 91-93, 96-114, 148-150
	 source_acceptance_test/utils/json_schema_helper.py     107     13    88%   30-31, 38, 41, 65-68, 96, 120, 192-194
	 ----------------------------------------------------------------------------------
	 TOTAL                                                 1569    350    78%

Build Passed

Test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:63: Skipping TestIncremental.test_two_sequential_reads: not found in the config.
================= 28 passed, 1 skipped, 29 warnings in 40.78s ==================

@YiyangLi
Copy link
Contributor

YiyangLi commented Dec 1, 2022

/publish connector=connectors/source-firebolt

🕑 Publishing the following connectors:
connectors/source-firebolt
https://github.com/airbytehq/airbyte/actions/runs/3594615506


Connector Did it publish? Were definitions generated?
connectors/source-firebolt

if you have connectors that successfully published but failed definition generation, follow step 4 here ▶️

@marcosmarxm
Copy link
Member

marcosmarxm commented Dec 2, 2022

/publish connector=connectors/source-firebolt

🕑 Publishing the following connectors:
connectors/source-firebolt
https://github.com/airbytehq/airbyte/actions/runs/3604805468


Connector Did it publish? Were definitions generated?
connectors/source-firebolt

if you have connectors that successfully published but failed definition generation, follow step 4 here ▶️

@@ -55,7 +55,8 @@ You can now use the Airbyte Firebolt source.

## Changelog


.pre-commit-config.yaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this @YiyangLi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation bounty bounty-L Maintainer program: claimable large bounty PR community connectors/source/firebolt reward-150
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

6 participants