Skip to content

🎉 New Source: Convex.dev [python cdk]#18403

Merged
Marcos Marx (marcosmarxm) merged 51 commits intoairbytehq:masterfrom
ldanilek:new-convex-connector
Nov 8, 2022
Merged

🎉 New Source: Convex.dev [python cdk]#18403
Marcos Marx (marcosmarxm) merged 51 commits intoairbytehq:masterfrom
ldanilek:new-convex-connector

Conversation

@ldanilek
Copy link
Copy Markdown
Contributor

@ldanilek Lee Danilek (ldanilek) commented Oct 24, 2022

What

Hacktoberfest: airbytehq/connector-contest#225
I work at Convex, where we're building a new backend as a service platform, and we'd like to have a connector between Convex's database and Airbyte.

Create a new source connector to export data from Convex (https://convex.dev) into analytics tools.

Screenshots of the connector running locally:

Screen Shot 2022-10-24 at 1 03 25 PM
Screen Shot 2022-10-24 at 1 18 10 PM

How

  1. Generate a new connector from the Python CDK tutorial
  2. Created new endpoints in the Convex API: /json_schemas, /list_snapshot, /document_deltas
  3. Updated the new connector to use the APIs, until check, discover, and read work
  4. Updated the generated tests until they pass locally

Recommended reading order

  1. source_convex/spec.yaml
  2. source_convex/source.py
  3. docs/integrations/sources/convex.md
  4. source-convex/bootstrap.md
  5. resources/seed/source_definitions.yaml

🚨 User Impact 🚨

New source connector in release stage "alpha".

Pre-merge Checklist

New Connector

Community member or Airbyter

  • Community member? 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
    • docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
    • docs/integrations/README.md
    • airbyte-integrations/builds.md
  • 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 by running the /publish command described here
  • After the connector is published, connector added to connector index as described here
  • Seed specs have been re-generated by building the platform and committing the changes to the seed spec files, as described here

Tests

Unit

Put your unit tests output here.

$ python -m pytest unit_tests
Test session starts (platform: darwin, Python 3.9.11, pytest 6.1.2, pytest-sugar 0.9.5)
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/Users/lee/src/airbyte/airbyte-integrations/connectors/source-convex/.hypothesis/examples')
rootdir: /Users/lee/src/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/connectors/source-convex/unit_tests/test_incremental_streams.py::test_cursor_field ✓                                                                                                                                                      6% ▋         
 airbyte-integrations/connectors/source-convex/unit_tests/test_incremental_streams.py::test_get_updated_state ✓                                                                                                                                                11% █▎        
 airbyte-integrations/connectors/source-convex/unit_tests/test_incremental_streams.py::test_stream_slices ✓                                                                                                                                                    17% █▋        
 airbyte-integrations/connectors/source-convex/unit_tests/test_incremental_streams.py::test_supports_incremental ✓                                                                                                                                             22% ██▎       
 airbyte-integrations/connectors/source-convex/unit_tests/test_incremental_streams.py::test_source_defined_cursor ✓                                                                                                                                            28% ██▊       
 airbyte-integrations/connectors/source-convex/unit_tests/test_incremental_streams.py::test_stream_checkpoint_interval ✓                                                                                                                                       33% ███▍      
 airbyte-integrations/connectors/source-convex/unit_tests/test_source.py::test_check_connection ✓                                                                                                                                                              39% ███▉      
 airbyte-integrations/connectors/source-convex/unit_tests/test_source.py::test_streams ✓                                                                                                                                                                       44% ████▌     
 airbyte-integrations/connectors/source-convex/unit_tests/test_streams.py::test_request_params ✓                                                                                                                                                               50% █████     
 airbyte-integrations/connectors/source-convex/unit_tests/test_streams.py::test_next_page_token ✓                                                                                                                                                              56% █████▋    
 airbyte-integrations/connectors/source-convex/unit_tests/test_streams.py::test_parse_response ✓                                                                                                                                                               61% ██████▎   
 airbyte-integrations/connectors/source-convex/unit_tests/test_streams.py::test_request_headers ✓                                                                                                                                                              67% ██████▋   
 airbyte-integrations/connectors/source-convex/unit_tests/test_streams.py::test_http_method ✓                                                                                                                                                                  72% ███████▎  
 airbyte-integrations/connectors/source-convex/unit_tests/test_streams.py::test_should_retry[HTTPStatus.OK-False] ✓                                                                                                                                            78% ███████▊  
 airbyte-integrations/connectors/source-convex/unit_tests/test_streams.py::test_should_retry[HTTPStatus.BAD_REQUEST-False] ✓                                                                                                                                   83% ████████▍ 
 airbyte-integrations/connectors/source-convex/unit_tests/test_streams.py::test_should_retry[HTTPStatus.TOO_MANY_REQUESTS-True] ✓                                                                                                                              89% ████████▉ 
 airbyte-integrations/connectors/source-convex/unit_tests/test_streams.py::test_should_retry[HTTPStatus.INTERNAL_SERVER_ERROR-True] ✓                                                                                                                          94% █████████▌
 airbyte-integrations/connectors/source-convex/unit_tests/test_streams.py::test_backoff_time ✓                                                                                                                                                                100% ██████████
============================================================================================================================= warnings summary ==============================================================================================================================
airbyte-integrations/connectors/source-convex/unit_tests/test_incremental_streams.py: 6 warnings
airbyte-integrations/connectors/source-convex/unit_tests/test_source.py: 2 warnings
airbyte-integrations/connectors/source-convex/unit_tests/test_streams.py: 10 warnings
  /Users/lee/src/airbyte/airbyte-integrations/connectors/source-convex/.venv/lib/python3.9/site-packages/airbyte_cdk/sources/streams/http/http.py:41: DeprecationWarning: Call to deprecated class NoAuth. (Set `authenticator=None` instead) -- Deprecated since version 0.1.20.
    self._authenticator: HttpAuthenticator = NoAuth()

airbyte-integrations/connectors/source-convex/unit_tests/test_incremental_streams.py: 6 warnings
airbyte-integrations/connectors/source-convex/unit_tests/test_source.py: 2 warnings
airbyte-integrations/connectors/source-convex/unit_tests/test_streams.py: 10 warnings
  /Users/lee/src/airbyte/airbyte-integrations/connectors/source-convex/.venv/lib/python3.9/site-packages/deprecated/classic.py:173: DeprecationWarning: Call to deprecated class HttpAuthenticator. (Use requests.auth.AuthBase instead) -- Deprecated since version 0.1.20.
    return old_new1(cls, *args, **kwargs)

-- Docs: https://docs.pytest.org/en/stable/warnings.html

Results (0.16s):
      18 passed
Integration

Put your integration tests output here.

no custom integration tests

Acceptance

from pytest:

$ python -m pytest integration_tests -p integration_tests.acceptance
Test session starts (platform: darwin, Python 3.9.11, pytest 6.2.5, pytest-sugar 0.9.5)
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/Users/lee/src/airbyte/airbyte-integrations/connectors/source-convex/.hypothesis/examples')
rootdir: /Users/lee/src/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] ✓                                                                                                                        3% ▍         
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_match_expected[inputs0] ✓                                                                                                                           7% ▊         
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_docker_env[inputs0] ✓                                                                                                                              10% █         
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_oneof_usage[inputs0] ✓                                                                                                                             14% █▍        
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_required[inputs0] ✓                                                                                                                                17% █▊        
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_optional[inputs0] ✓                                                                                                                                21% ██▏       
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_has_secret[inputs0] ✓                                                                                                                              24% ██▌       
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_secret_never_in_the_output[inputs0] ✓                                                                                                              28% ██▊       
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_defined_refs_exist_in_json_spec_file[inputs0] ✓                                                                                                    31% ███▏      
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_oauth_flow_parameters[inputs0] ✓                                                                                                                   34% ███▌      
Pulling docker image airbyte/source-convex:latest
{"type": "LOG", "log": {"level": "WARN", "message": "\n We did not find the airbyte/source-convex: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                                                                                                                  38% ███▊      
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_additional_properties_is_true[inputs0] ✓                                                                                                           41% ████▎     
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestConnection.test_check[inputs0] ✓                                                                                                                             45% ████▌     
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestConnection.test_check[inputs1] ✓                                                                                                                             48% ████▉     
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestDiscovery.test_discover[inputs0] ✓                                                                                                                           52% █████▎    
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestDiscovery.test_defined_cursors_exist_in_schema[inputs0] ✓                                                                                                    55% █████▌    
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestDiscovery.test_defined_refs_exist_in_schema[inputs0] ✓                                                                                                       59% █████▉    
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestDiscovery.test_defined_keyword_exist_in_schema[inputs0-allOf] ✓                                                                                              62% ██████▎   
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestDiscovery.test_defined_keyword_exist_in_schema[inputs0-not] ✓                                                                                                66% ██████▋   
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestDiscovery.test_primary_keys_exist_in_schema[inputs0] ✓                                                                                                       69% ██████▉   
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestDiscovery.test_streams_has_sync_modes[inputs0] ✓                                                                                                             72% ███████▎  
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestDiscovery.test_additional_properties_is_true[inputs0] ✓                                                                                                      76% ███████▋  
Pulling docker image airbyte/source-convex:latest
{"type": "LOG", "log": {"level": "WARN", "message": "\n We did not find the airbyte/source-convex: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                                                                                                             79% ███████▉  {"type": "LOG", "log": {"level": "INFO", "message": "Actual records for stream users:"}}
{"type": "LOG", "log": {"level": "INFO", "message": "[\n {\n  \"_creationTime\": 1652593901795.4175,\n  \"_id\": {\n   \"$id\": \"users|wnmxwZrHuQa8TWcCXl8faAW\"\n  },\n  \"name\": \"Lee Danilek\",\n  \"tokenIdentifier\": \"https://dev-wgspahhl.us.auth0.com/|google-oauth2|116819734026499097324\",\n  \"_ts\": 1660025892365542190,\n  \"_ab_cdc_lsn\": 1660025892365542190,\n  \"_ab_cdc_updated_at\": \"2022-08-09T06:18:12.365542\",\n  \"_deleted\": false,\n  \"_ab_cdc_deleted_at\": null\n },\n {\n  \"_creationTime\": 1652600185784.3213,\n  \"_id\": {\n   \"$id\": \"users|8C6L6arHuQa8TWcCXl8faAW\"\n  },\n  \"name\": \"Lee Danilek\",\n  \"tokenIdentifier\": \"https://dev-wgspahhl.us.auth0.com/|google-oauth2|106075083235883896910\",\n  \"_ts\": 1660025892365542190,\n  \"_ab_cdc_lsn\": 1660025892365542190,\n  \"_ab_cdc_updated_at\": \"2022-08-09T06:18:12.365542\",\n  \"_deleted\": false,\n  \"_ab_cdc_deleted_at\": null\n }\n]"}}
{"type": "LOG", "log": {"level": "INFO", "message": "Expected records for stream users:"}}
{"type": "LOG", "log": {"level": "INFO", "message": "[\n {\n  \"_id\": {\n   \"$id\": \"users|wnmxwZrHuQa8TWcCXl8faAW\"\n  },\n  \"_creationTime\": 1652593901795.4175,\n  \"name\": \"Lee Danilek\",\n  \"tokenIdentifier\": \"https://dev-wgspahhl.us.auth0.com/|google-oauth2|116819734026499097324\",\n  \"_ts\": 1660025892365542190,\n  \"_ab_cdc_deleted_at\": null,\n  \"_ab_cdc_lsn\": 1660025892365542190,\n  \"_ab_cdc_updated_at\": \"2022-08-09T06:18:12.365542\",\n  \"_deleted\": false\n }\n]"}}
{"type": "LOG", "log": {"level": "INFO", "message": "Actual records for stream posts:"}}
{"type": "LOG", "log": {"level": "INFO", "message": "[\n {\n  \"_creationTime\": 1652595311880.4985,\n  \"_id\": {\n   \"$id\": \"posts|UZs05arHuQa8TWcCXl8faAW\"\n  },\n  \"author\": {\n   \"$id\": \"users|wnmxwZrHuQa8TWcCXl8faAW\"\n  },\n  \"body\": \"first!\",\n  \"time\": 1652595311875.6301,\n  \"_ts\": 1660025892355943945,\n  \"_ab_cdc_lsn\": 1660025892355943945,\n  \"_ab_cdc_updated_at\": \"2022-08-09T06:18:12.355944\",\n  \"_deleted\": false,\n  \"_ab_cdc_deleted_at\": null\n },\n {\n  \"_creationTime\": 1652595855409.799,\n  \"_id\": {\n   \"$id\": \"posts|iQKB5arHuQa8TWcCXl8faAW\"\n  },\n  \"author\": {\n   \"$id\": \"users|wnmxwZrHuQa8TWcCXl8faAW\"\n  },\n  \"body\": \"second!\",\n  \"time\": 1652595855404.5964,\n  \"_ts\": 1660025892355943945,\n  \"_ab_cdc_lsn\": 1660025892355943945,\n  \"_ab_cdc_updated_at\": \"2022-08-09T06:18:12.355944\",\n  \"_deleted\": false,\n  \"_ab_cdc_deleted_at\": null\n },\n {\n  \"_creationTime\": 1652596738261.2463,\n  \"_id\": {\n   \"$id\": \"posts|iwqJ5arHuQa8TWcCXl8faAW\"\n  },\n  \"author\": {\n   \"$id\": \"users|wnmxwZrHuQa8TWcCXl8faAW\"\n  },\n  \"body\": \"third!\",\n  \"time\": 1652596738256.5,\n  \"_ts\": 1660025892355943945,\n  \"_ab_cdc_lsn\": 1660025892355943945,\n  \"_ab_cdc_updated_at\": \"2022-08-09T06:18:12.355944\",\n  \"_deleted\": false,\n  \"_ab_cdc_deleted_at\": null\n },\n {\n  \"_creationTime\": 1652600339788.9646,\n  \"_id\": {\n   \"$id\": \"posts|mKqn7arHuQa8TWcCXl8faAW\"\n  },\n  \"author\": {\n   \"$id\": \"users|8C6L6arHuQa8TWcCXl8faAW\"\n  },\n  \"body\": \"i'm here too!\",\n  \"time\": 1652600339784.2883,\n  \"_ts\": 1660025892355943945,\n  \"_ab_cdc_lsn\": 1660025892355943945,\n  \"_ab_cdc_updated_at\": \"2022-08-09T06:18:12.355944\",\n  \"_deleted\": false,\n  \"_ab_cdc_deleted_at\": null\n },\n {\n  \"_creationTime\": 1652635518820.4812,\n  \"_id\": {\n   \"$id\": \"posts|euuNEarHuQa8TWcCXl8faAW\"\n  },\n  \"author\": {\n   \"$id\": \"users|wnmxwZrHuQa8TWcCXl8faAW\"\n  },\n  \"body\": \"hi\",\n  \"time\": 1652635518815.313,\n  \"_ts\": 1660025892355943945,\n  \"_ab_cdc_lsn\": 1660025892355943945,\n  \"_ab_cdc_updated_at\": \"2022-08-09T06:18:12.355944\",\n  \"_deleted\": false,\n  \"_ab_cdc_deleted_at\": null\n },\n {\n  \"_creationTime\": 1652635567679.742,\n  \"_id\": {\n   \"$id\": \"posts|2VDREarHuQa8TWcCXl8faAW\"\n  },\n  \"author\": {\n   \"$id\": \"users|wnmxwZrHuQa8TWcCXl8faAW\"\n  },\n  \"body\": \"hi yourself\",\n  \"time\": 1652635567674.711,\n  \"_ts\": 1660025892355943945,\n  \"_ab_cdc_lsn\": 1660025892355943945,\n  \"_ab_cdc_updated_at\": \"2022-08-09T06:18:12.355944\",\n  \"_deleted\": false,\n  \"_ab_cdc_deleted_at\": null\n }\n]"}}
{"type": "LOG", "log": {"level": "INFO", "message": "Expected records for stream posts:"}}
{"type": "LOG", "log": {"level": "INFO", "message": "[\n {\n  \"_id\": {\n   \"$id\": \"posts|UZs05arHuQa8TWcCXl8faAW\"\n  },\n  \"_creationTime\": 1652595311880.4985,\n  \"author\": {\n   \"$id\": \"users|wnmxwZrHuQa8TWcCXl8faAW\"\n  },\n  \"body\": \"first!\",\n  \"time\": 1652595311875.6301,\n  \"_ts\": 1660025892355943945,\n  \"_ab_cdc_deleted_at\": null,\n  \"_ab_cdc_lsn\": 1660025892355943945,\n  \"_ab_cdc_updated_at\": \"2022-08-09T06:18:12.355944\",\n  \"_deleted\": false\n },\n {\n  \"_id\": {\n   \"$id\": \"posts|iQKB5arHuQa8TWcCXl8faAW\"\n  },\n  \"_creationTime\": 1652595855409.799,\n  \"author\": {\n   \"$id\": \"users|wnmxwZrHuQa8TWcCXl8faAW\"\n  },\n  \"body\": \"second!\",\n  \"time\": 1652595855404.5964,\n  \"_ts\": 1660025892355943945,\n  \"_ab_cdc_deleted_at\": null,\n  \"_ab_cdc_lsn\": 1660025892355943945,\n  \"_ab_cdc_updated_at\": \"2022-08-09T06:18:12.355944\",\n  \"_deleted\": false\n }\n]"}}

 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestBasicRead.test_read[inputs0] ✓                                                                                                                               83% ████████▍ 
{"type": "LOG", "log": {"level": "ERROR", "message": "Docker container was failed, code 1, error:\n{\"type\": \"TRACE\", \"trace\": {\"type\": \"ERROR\", \"emitted_at\": 1666297526816.5, \"error\": {\"message\": \"Something went wrong in the connector. See the logs for more details.\", \"internal_message\": \"2 validation errors for ConfiguredAirbyteCatalog\\nstreams -> 0 -> sync_mode\\n  value is not a valid enumeration member; permitted: 'full_refresh', 'incremental' (type=type_error.enum; enum_values=[<SyncMode.full_refresh: 'full_refresh'>, <SyncMode.incremental: 'incremental'>])\\nstreams -> 0 -> destination_sync_mode\\n  value is not a valid enumeration member; permitted: 'append', 'overwrite', 'append_dedup' (type=type_error.enum; enum_values=[<DestinationSyncMode.append: 'append'>, <DestinationSyncMode.overwrite: 'overwrite'>, <DestinationSyncMode.append_dedup: 'append_dedup'>])\", \"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 123, 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 111, in run\\n    config_catalog = self.source.read_catalog(parsed_args.catalog)\\n  File \\\"/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/source.py\\\", line 90, in read_catalog\\n    return ConfiguredAirbyteCatalog.parse_obj(self.read_config(catalog_path))\\n  File \\\"/usr/local/lib/python3.9/site-packages/pydantic/main.py\\\", line 521, in parse_obj\\n    return cls(**obj)\\n  File \\\"/usr/local/lib/python3.9/site-packages/pydantic/main.py\\\", line 341, in __init__\\n    raise validation_error\\npydantic.error_wrappers.ValidationError: 2 validation errors for ConfiguredAirbyteCatalog\\nstreams -> 0 -> sync_mode\\n  value is not a valid enumeration member; permitted: 'full_refresh', 'incremental' (type=type_error.enum; enum_values=[<SyncMode.full_refresh: 'full_refresh'>, <SyncMode.incremental: 'incremental'>])\\nstreams -> 0 -> destination_sync_mode\\n  value is not a valid enumeration member; permitted: 'append', 'overwrite', 'append_dedup' (type=type_error.enum; enum_values=[<DestinationSyncMode.append: 'append'>, <DestinationSyncMode.overwrite: 'overwrite'>, <DestinationSyncMode.append_dedup: 'append_dedup'>])\\n\", \"failure_type\": \"system_error\"}}}\n"}}

 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestBasicRead.test_airbyte_trace_message_on_failure[inputs0] ✓                                                                                                   86% ████████▋ 
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_full_refresh.py::TestFullRefresh.test_sequential_reads[inputs0] ✓                                                                                                         90% █████████ 
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_incremental.py::TestIncremental.test_two_sequential_reads[inputs0] ✓                                                                                                      93% █████████▍
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_incremental.py::TestIncremental.test_read_sequential_slices[inputs0] ✓                                                                                                    97% █████████▋
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_incremental.py::TestIncremental.test_state_with_abnormally_large_values[inputs0] ✓                                                                                       100% ██████████
{"type": "LOG", "log": {"level": "INFO", "message": "/Users/lee/src/airbyte/airbyte-integrations/connectors/source-convex - SAT run - 2116a2ca9cfe222cf51faf5b7b4a4511100a8739 - PASSED"}}

========================================================================================================================== short test summary info ==========================================================================================================================
SKIPPED [1] ../../bases/source-acceptance-test/source_acceptance_test/tests/test_core.py:51: The previous connector image could not be retrieved.
SKIPPED [1] ../../bases/source-acceptance-test/source_acceptance_test/tests/test_core.py:229: The previous connector image could not be retrieved.

Results (41.83s):
      27 passed
       2 skipped

I don't understand that ConfiguredAirbyteCatalog error. it doesn't say which value it doesn't like, and source-convex/integration_tests/configured_catalog.json has valid values, as far as i can tell. also this error doesn't show up when running the same tests in gradle.

From gradle:

$ ./gradlew :airbyte-integrations:connectors:source-convex:sourceAcceptanceTest
... running dependencies ...
> Task :airbyte-integrations:connectors:source-convex: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: sugar-0.9.5, cov-3.0.0, requests-mock-1.9.3, mock-3.6.1, hypothesis-6.54.6, timeout-1.4.2
collected 29 items

test_core.py ..........s...........s..                                   [ 86%]
test_full_refresh.py .                                                   [ 89%]
test_incremental.py ...                                                  [100%]


=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/tests/test_core.py:51: The previous connector image could not be retrieved.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/tests/test_core.py:229: The previous connector image could not be retrieved.
======================== 27 passed, 2 skipped in 42.54s ========================

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

Execution optimizations have been disabled for 1 invalid unit(s) of work during this build to ensure correctness.
Please consult deprecation warnings for more details.

BUILD SUCCESSFUL in 3m 21s
48 actionable tasks: 23 executed, 25 up-to-date

@@ -0,0 +1,4 @@
{
"deployment_name": "descriptive-vulture-260",
"access_key": "Your access token"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

how do i give the access key used in acceptance tests? it's stored in secrets/config.json locally which is gitignored.

Copy link
Copy Markdown
Contributor

@marcosmarxm Marcos Marx (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.

- name: Convex
sourceDefinitionId: c332628c-f55c-4017-8222-378cfafda9b2
dockerRepository: airbyte/source-convex
dockerImageTag: dev
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The image is generated during the review process. Someone will trigger CI actions to test and publish the docker image to Dockerhub.
Yes. the image must be tagged 0.1.0

| Chartmogul | [![source-chartmogul](https://img.shields.io/endpoint?url=https%3A%2F%2Fdnsgjos7lj2fu.cloudfront.net%2Ftests%2Fsummary%2Fsource-chartmogul%2Fbadge.json)](https://dnsgjos7lj2fu.cloudfront.net/tests/summary/source-chartmogul/) |
| Cart.com | [![source-cart](https://img.shields.io/endpoint?url=https%3A%2F%2Fdnsgjos7lj2fu.cloudfront.net%2Ftests%2Fsummary%2Fsource-cart%2Fbadge.json)](https://dnsgjos7lj2fu.cloudfront.net/tests/summary/source-cart/) |
| Close.com | [![source-close-com](https://img.shields.io/endpoint?url=https%3A%2F%2Fdnsgjos7lj2fu.cloudfront.net%2Ftests%2Fsummary%2Fsource-close-com%2Fbadge.json)](https://dnsgjos7lj2fu.cloudfront.net/tests/summary/source-close-com/) |
| Convex | [![source-convex](https://img.shields.io/endpoint?url=https%3A%2F%2Fdnsgjos7lj2fu.cloudfront.net%2Ftests%2Fsummary%2Fsource-convex%2Fbadge.json)](https://dnsgjos7lj2fu.cloudfront.net/tests/summary/source-convex/) |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

During the review process you're going to see the CI results.

@@ -0,0 +1,19 @@
documentationUrl: https://docs.airbyte.com/integrations/sources/convex
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes

Comment on lines +140 to +143
if self._snapshot_has_more:
return "/api/list_snapshot"
else:
return "/api/document_deltas"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can you link those endpoints to convex.dev api docs?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we don't have docs for these endpoints yet, because i just created them recently. i'll work on exposing documentation for them now

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

linked to documentation here and in bootstrap.md

@marcosmarxm
Copy link
Copy Markdown
Contributor

Lee Danilek (@ldanilek) please ask my review again after all changes are resolved.

@ldanilek
Copy link
Copy Markdown
Contributor Author

Marcos Marx (@marcosmarxm) i've updated the PR so it should be ready for re-review. thanks!

@marcosmarxm
Copy link
Copy Markdown
Contributor

Awesome, Lee Danilek (@ldanilek) do you have test credentials to share?

@ldanilek
Copy link
Copy Markdown
Contributor Author

Copy link
Copy Markdown
Contributor

@marcosmarxm Marcos Marx (marcosmarxm) left a comment

Choose a reason for hiding this comment

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

Thanks Lee Danilek (@ldanilek) I'll publish the connector later today!

@marcosmarxm
Copy link
Copy Markdown
Contributor

Marcos Marx (marcosmarxm) commented Nov 4, 2022

Hello! Your PR is approved but didn't have the time to publish and merge it this week. As you can check in Chris' comment all PRs submitted before 2-nov are eligible to win the prize. I'll be out of the office on Friday and return Monday to start publishing your contribution. Any question you can send a message in #hacktoberfest-2022 channel in Airbyte's Slack.

Have a good weekend and thank you for this amazing contribution for Hacktoberfest 🎉

@ldanilek
Copy link
Copy Markdown
Contributor Author

Hi Marcos Marx (@marcosmarxm) . Do you have a timeline for when this connector can be deployed? I'm not worried about the hacktober prize. I'm trying to launch this feature for customers of Convex, where I work.

@marcosmarxm
Copy link
Copy Markdown
Contributor

Marcos Marx (marcosmarxm) commented Nov 8, 2022

/test connector=connectors/source-convex

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

Name                        Stmts   Miss  Cover
-----------------------------------------------
source_convex/__init__.py       2      0   100%
source_convex/source.py        99     20    80%
-----------------------------------------------
TOTAL                         101     20    80%
	 Name                                                 Stmts   Miss  Cover   Missing
	 ----------------------------------------------------------------------------------
	 source_acceptance_test/base.py                          12      4    67%   16-19
	 source_acceptance_test/config.py                       133      3    98%   87, 93, 230
	 source_acceptance_test/conftest.py                     196     97    51%   35, 41-43, 48, 54, 60, 66, 72-74, 80-95, 100, 105-107, 113-115, 121-122, 127-128, 133, 139, 148-157, 163-168, 232, 238, 244-250, 258-263, 271-284, 289-295, 302-313, 320-336
	 source_acceptance_test/plugin.py                        69     25    64%   22-23, 31, 36, 120-140, 144-148
	 source_acceptance_test/tests/test_core.py              329    106    68%   39, 50-58, 63-70, 74-75, 79-80, 164, 202-219, 228-236, 240-245, 251, 284-289, 327-334, 377-379, 382, 447-455, 484-485, 491, 494, 530-540, 553-578
	 source_acceptance_test/tests/test_incremental.py       145     20    86%   21-23, 29-31, 36-43, 48-61, 224
	 source_acceptance_test/utils/asserts.py                 37      2    95%   57-58
	 source_acceptance_test/utils/common.py                  77     10    87%   15-16, 24-30, 64, 67
	 source_acceptance_test/utils/compare.py                 62     23    63%   21-51, 68, 97-99
	 source_acceptance_test/utils/config_migration.py        23     23     0%   5-37
	 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                                                 1479    376    75%

Build Passed

Test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/tests/test_core.py:51: The previous connector image could not be retrieved.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/tests/test_core.py:229: The previous connector image could not be retrieved.
================= 27 passed, 2 skipped, 29 warnings in 37.53s ==================

@marcosmarxm
Copy link
Copy Markdown
Contributor

Marcos Marx (marcosmarxm) commented Nov 8, 2022

/publish connector=connectors/source-convex

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


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

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

@marcosmarxm Marcos Marx (marcosmarxm) merged commit 29d74fc into airbytehq:master Nov 8, 2022
@RealChrisSean Chris "Sean" Dabatos (RealChrisSean) added the python Pull requests that update Python code label Nov 15, 2022
@marcosmarxm Marcos Marx (marcosmarxm) changed the title 🎉 New Source: Convex.dev 🎉 New Source: Convex.dev [python cdk] Nov 18, 2022
Akash Kulkarni (akashkulk) pushed a commit that referenced this pull request Dec 2, 2022
* convex source

* fixed unit tests

* use the smaller test instance

* fix integration tests and pagination

* fix tableName casing in api call

* fix logo

* more shapes -- thinking about moving this to an internal api

* use new /json_schemas api

* use new APIs

* remove unused start_date

* doc skeleton

* fix deletes with incremental sync

* fix test of json_schema

* fix expected records

* merge

* version and docs

* fix test

* fix docs url

* mention that you need to ask convex to enable it for your account

* docs

* two stage pagination for initial sync. some unit tests not working

* fixed all the unit tests, but we need to push backends before acceptance tests work

* fix snapshot pagination

* fix integration tests

* some checkboxes from the PR description

* Update airbyte-integrations/connectors/source-convex/source_convex/source.py

Co-authored-by: Sujay Jayakar <[email protected]>

* Update airbyte-integrations/connectors/source-convex/source_convex/source.py

Co-authored-by: Sujay Jayakar <[email protected]>

* stop storing the delta_has_more in state

* fix mypy

* use UTC timestamps

* rename instance_name to deployment_name

* include data format request param

* remove dev docker image

* fix unit test

* documentation

* .

* code review

* documentation and change deployment_name to deployment_url

* fix pip dependency

* regenerate the spec file

Co-authored-by: Sujay Jayakar <[email protected]>
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 community connectors/source/convex hacktober internal python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants