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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Source Tiktok: fails to compare stream state #8200

Closed
n0rritt opened this issue Nov 23, 2021 · 0 comments 路 Fixed by #8292
Closed

馃悰 Source Tiktok: fails to compare stream state #8200

n0rritt opened this issue Nov 23, 2021 · 0 comments 路 Fixed by #8292

Comments

@n0rritt
Copy link
Contributor

n0rritt commented Nov 23, 2021

Enviroment

  • Airbyte version: 0.32.0-alpha
  • OS Version / Instance: Ubuntu 18.04.6 LTS
  • Deployment: Docker
  • Source Connector and version: Tiktok Marketing 0.1.1
  • Destination Connector and version:
  • Severity: Low
  • Step where error happened: Local Test

Current Behavior

Using the latest Tiktok connector implementation and running
python main.py read --config secrets/config.json --catalog integration_tests/test_catalog.json
where test_catalog.json is

{
  "streams": [
    {
      "stream": {
        "name": "campaigns",
        "json_schema": {},
        "supported_sync_modes": ["full_refresh", "incremental"],
        "source_defined_cursor": true,
        "default_cursor_field": ["modify_time"],
        "source_defined_primary_key": [["campaign_id"]]
      },
      "sync_mode": "incremental",
      "destination_sync_mode": "append"
    }
  ]
}

We get a type comparison error raised for streams.py line 256.

Expected Behavior

Executing the main.py locally should run correctly

Logs

LOG

Traceback (most recent call last):
  File "/home/hai/workspace/sss/airbyte/airbyte-integrations/connectors/source-tiktok-marketing/main.py", line 13, in <module>
    launch(source, sys.argv[1:])
  File "/home/hai/workspace/sss/airbyte/airbyte-integrations/connectors/source-tiktok-marketing/.venv/lib/python3.7/site-packages/airbyte_cdk/entrypoint.py", line 108, in launch
    for message in source_entrypoint.run(parsed_args):
  File "/home/hai/workspace/sss/airbyte/airbyte-integrations/connectors/source-tiktok-marketing/.venv/lib/python3.7/site-packages/airbyte_cdk/entrypoint.py", line 99, in run
    for message in generator:
  File "/home/hai/workspace/sss/airbyte/airbyte-integrations/connectors/source-tiktok-marketing/.venv/lib/python3.7/site-packages/airbyte_cdk/sources/abstract_source.py", line 108, in read
    raise e
  File "/home/hai/workspace/sss/airbyte/airbyte-integrations/connectors/source-tiktok-marketing/.venv/lib/python3.7/site-packages/airbyte_cdk/sources/abstract_source.py", line 104, in read
    internal_config=internal_config,
  File "/home/hai/workspace/sss/airbyte/airbyte-integrations/connectors/source-tiktok-marketing/.venv/lib/python3.7/site-packages/airbyte_cdk/sources/abstract_source.py", line 134, in _read_stream
    for record in record_iterator:
  File "/home/hai/workspace/sss/airbyte/airbyte-integrations/connectors/source-tiktok-marketing/.venv/lib/python3.7/site-packages/airbyte_cdk/sources/abstract_source.py", line 179, in _read_incremental
    for record_counter, record_data in enumerate(records, start=1):
  File "/home/hai/workspace/sss/airbyte/airbyte-integrations/connectors/source-tiktok-marketing/.venv/lib/python3.7/site-packages/airbyte_cdk/sources/streams/http/http.py", line 353, in read_records
    yield from self.parse_response(response, stream_state=stream_state, stream_slice=stream_slice)
  File "/home/hai/workspace/sss/airbyte/airbyte-integrations/connectors/source-tiktok-marketing/source_tiktok_marketing/streams.py", line 256, in parse_response
    if updated <= state:
TypeError: '<=' not supported between instances of 'str' and 'JsonUpdatedState'
{"type": "LOG", "log": {"level": "ERROR", "message": "Encountered an exception while reading stream SourceTiktokMarketing\nTraceback (most recent call last):\n  File \"/home/hai/workspace/sss/airbyte/airbyte-integrations/connectors/source-tiktok-marketing/.venv/lib/python3.7/site-packages/airbyte_cdk/sources/abstract_source.py\", line 104, in read\n    internal_config=internal_config,\n  File \"/home/hai/workspace/sss/airbyte/airbyte-integrations/connectors/source-tiktok-marketing/.venv/lib/python3.7/site-packages/airbyte_cdk/sources/abstract_source.py\", line 134, in _read_stream\n    for record in record_iterator:\n  File \"/home/hai/workspace/sss/airbyte/airbyte-integrations/connectors/source-tiktok-marketing/.venv/lib/python3.7/site-packages/airbyte_cdk/sources/abstract_source.py\", line 179, in _read_incremental\n    for record_counter, record_data in enumerate(records, start=1):\n  File \"/home/hai/workspace/sss/airbyte/airbyte-integrations/connectors/source-tiktok-marketing/.venv/lib/python3.7/site-packages/airbyte_cdk/sources/streams/http/http.py\", line 353, in read_records\n    yield from self.parse_response(response, stream_state=stream_state, stream_slice=stream_slice)\n  File \"/home/hai/workspace/sss/airbyte/airbyte-integrations/connectors/source-tiktok-marketing/source_tiktok_marketing/streams.py\", line 256, in parse_response\n    if updated <= state:\nTypeError: '<=' not supported between instances of 'str' and 'JsonUpdatedState'"}}

Steps to Reproduce

  1. Checkout latest Airbyte state from master
  2. Change directory to source-tiktok-marketing and follow README
  3. Create secrets/config.json and test_catalog.json as above
  4. Run python main.py read --config secrets/config.json --catalog integration_tests/test_catalog.json

Are you willing to submit a PR?

Yes

@n0rritt n0rritt added the type/bug Something isn't working label Nov 23, 2021
@sherifnada sherifnada added the area/connectors Connector related issues label Nov 29, 2021
@antixar antixar self-assigned this Nov 29, 2021
@alafanechere alafanechere changed the title Tiktok connector fails to compare stream state 馃悰 Source Tiktok: fails to compare stream state Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants