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

Move null type to first position in type lists #9

Closed
wants to merge 1 commit into from

Conversation

marknotfound
Copy link

Description & motivation

I believe this should fix #8 which to me is definitely an issue with bigquery's target (see RealSelf/target-bigquery#10 linked in above issue), but one we can fix here as well.

This is a...

  • 🎉 New feature
  • 🪲 Bug fix
  • ⚙️ Refactor
  • ♻️ Housekeeping

Screenshots

Open questions

How to test

@hack-c
Copy link

hack-c commented Feb 17, 2022

Beautiful ! this is great to see, thank you @marknotfound !

@dluftspring
Copy link
Owner

@hack-c can you pull this branch and confirm this solves the issue with target-bq before I give it the stamp of approval?

@marknotfound
Copy link
Author

@dluftspring This PR may not be necessary since the bug it's solving for in the bigquery target is actually in what looks like an unmaintained repo.

@hack-c I emailed you about this already but posting here for Dan as well. The bug is in https://github.com/RealSelf/target-bigquery/ but the repo listed on MeltanoHub is https://github.com/adswerve/target-bigquery which is a more recent fork of the other.

@dluftspring
Copy link
Owner

Very helpful thanks @marknotfound ! Going to add a comment to the issue.

@dluftspring
Copy link
Owner

@hack-c I'm happy to merge this if it will unblock you. Is the issue still persisting or was forking the adswerve repo enough to solve the problem?

Copy link
Owner

@dluftspring dluftspring left a comment

Choose a reason for hiding this comment

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

👍 We can revert if something goes wrong. Hard to tell from the CI run but I think this may be causing a JSON schema validation error because ['null', 'string'] is non standard formatting

@hack-c
Copy link

hack-c commented Feb 23, 2022 via email

@dluftspring
Copy link
Owner

All good! Can you close the issue then?

@hack-c
Copy link

hack-c commented Feb 23, 2022

I meant that the adswerve variant is the one that is giving the error.

@hack-c
Copy link

hack-c commented Feb 23, 2022

I can't make much out of this stack trace but maybe you can?

2022-02-23T18:17:22.881302Z [error    ] Loading failed                 code=2 job_id=2022-02-23T181715--tap-hellobaton--target-bigquery message=CRITICAL ['Traceback (most recent call last):\n', '  File "/Users/chack/Documents/Documents - Charles’s MacBook Pro/engineering/meltano-projects/baton-elt/baton-elt/.meltano/loaders/target-bigquery/venv/lib/python3.8/site-packages/target_bigquery/__init__.py", line 129, in main\n    for state in state_iterator:\n', '  File "/Users/chack/Documents/Documents - Charles’s MacBook Pro/engineering/meltano-projects/baton-elt/baton-elt/.meltano/loaders/target-bigquery/venv/lib/python3.8/site-packages/target_bigquery/process.py", line 54, in process\n    for s in handler.handle_record_message(msg):\n', '  File "/Users/chack/Documents/Documents - Charles’s MacBook Pro/engineering/meltano-projects/baton-elt/baton-elt/.meltano/loaders/target-bigquery/venv/lib/python3.8/site-packages/target_bigquery/processhandler.py", line 179, in handle_record_message\n    nr = format_record_to_schema(nr, self.bq_schema_dicts[stream])\n', '  File "/Users/chack/Documents/Documents - Charles’s MacBook Pro/engineering/meltano-projects/baton-elt/baton-elt/.meltano/loaders/target-bigquery/venv/lib/python3.8/site-packages/target_bigquery/schema.py", line 359, in format_record_to_schema\n    record[k] = conversion_dict[bq_schema[k]["type"]](v)\n', "KeyError: 'RECORD'\n"] name=meltano run_id=5810295c-53a4-4d36-a4a2-4f1274371656
2022-02-23T18:17:22.881600Z [debug    ] ELT could not be completed: Loader failed
For more detailed log messages, check the generated log file '/Users/chack/Documents/Documents - Charles’s MacBook Pro/engineering/meltano-projects/baton-elt/baton-elt/.meltano/logs/elt/2022-02-23T181715--tap-hellobaton--target-bigquery/5810295c-53a4-4d36-a4a2-4f1274371656/elt.log' or re-run the command using the '--log-level=debug' CLI flag. 
Traceback (most recent call last):
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/cli/elt.py", line 243, in _run_elt
    await _run_extract_load(log, elt_context, output_logger)
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/cli/elt.py", line 303, in _run_extract_load
    await singer_runner.run(
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/core/runner/singer.py", line 224, in run
    await self.invoke(
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/core/runner/singer.py", line 206, in invoke
    raise RunnerError("Loader failed", {PluginType.LOADERS: target_code})
meltano.core.runner.RunnerError: Loader failed

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/cli/elt.py", line 231, in _redirect_output
    yield
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/cli/elt.py", line 252, in _run_elt
    raise CliError(
meltano.cli.utils.CliError: ELT could not be completed: Loader failed
For more detailed log messages, check the generated log file '/Users/chack/Documents/Documents - Charles’s MacBook Pro/engineering/meltano-projects/baton-elt/baton-elt/.meltano/logs/elt/2022-02-23T181715--tap-hellobaton--target-bigquery/5810295c-53a4-4d36-a4a2-4f1274371656/elt.log' or re-run the command using the '--log-level=debug' CLI flag.
2022-02-23T18:17:22.882997Z [info     ] ELT could not be completed: Loader failed cmd_type=elt job_id=2022-02-23T181715--tap-hellobaton--target-bigquery name=meltano run_id=5810295c-53a4-4d36-a4a2-4f1274371656 stdio=stderr
2022-02-23T18:17:22.883209Z [info     ] For more detailed log messages, check the generated log file '/Users/chack/Documents/Documents - Charles’s MacBook Pro/engineering/meltano-projects/baton-elt/baton-elt/.meltano/logs/elt/2022-02-23T181715--tap-hellobaton--target-bigquery/5810295c-53a4-4d36-a4a2-4f1274371656/elt.log' or re-run the command using the '--log-level=debug' CLI flag. cmd_type=elt job_id=2022-02-23T181715--tap-hellobaton--target-bigquery name=meltano run_id=5810295c-53a4-4d36-a4a2-4f1274371656 stdio=stderr
2022-02-23T18:17:22.889625Z [debug    ] ELT could not be completed: Loader failed
For more detailed log messages, check the generated log file '/Users/chack/Documents/Documents - Charles’s MacBook Pro/engineering/meltano-projects/baton-elt/baton-elt/.meltano/logs/elt/2022-02-23T181715--tap-hellobaton--target-bigquery/5810295c-53a4-4d36-a4a2-4f1274371656/elt.log' or re-run the command using the '--log-level=debug' CLI flag. 
Traceback (most recent call last):
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/cli/elt.py", line 243, in _run_elt
    await _run_extract_load(log, elt_context, output_logger)
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/cli/elt.py", line 303, in _run_extract_load
    await singer_runner.run(
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/core/runner/singer.py", line 224, in run
    await self.invoke(
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/core/runner/singer.py", line 206, in invoke
    raise RunnerError("Loader failed", {PluginType.LOADERS: target_code})
meltano.core.runner.RunnerError: Loader failed

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/cli/__init__.py", line 47, in main
    cli(obj={"project": None})
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/cli/params.py", line 23, in decorate
    return func(*args, **kwargs)
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/cli/params.py", line 56, in decorate
    func(project, *args, **kwargs)
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/core/utils/__init__.py", line 71, in wrapper
    return run_async(func(*args, **kwargs))
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/core/utils/__init__.py", line 50, in run_async
    loop.run_until_complete(future)
  File "/Users/chack/anaconda3/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/cli/elt.py", line 133, in elt
    await _run_job(project, job, session, context_builder, force=force)
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/cli/elt.py", line 215, in _run_job
    await _run_elt(log, context_builder, output_logger)
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/cli/elt.py", line 252, in _run_elt
    raise CliError(
meltano.cli.utils.CliError: ELT could not be completed: Loader failed
For more detailed log messages, check the generated log file '/Users/chack/Documents/Documents - Charles’s MacBook Pro/engineering/meltano-projects/baton-elt/baton-elt/.meltano/logs/elt/2022-02-23T181715--tap-hellobaton--target-bigquery/5810295c-53a4-4d36-a4a2-4f1274371656/elt.log' or re-run the command using the '--log-level=debug' CLI flag.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/cli/__init__.py", line 55, in main
    raise CliError(str(err)) from err
meltano.cli.utils.CliError: ELT could not be completed: Loader failed
For more detailed log messages, check the generated log file '/Users/chack/Documents/Documents - Charles’s MacBook Pro/engineering/meltano-projects/baton-elt/baton-elt/.meltano/logs/elt/2022-02-23T181715--tap-hellobaton--target-bigquery/5810295c-53a4-4d36-a4a2-4f1274371656/elt.log' or re-run the command using the '--log-level=debug' CLI flag.
ELT could not be completed: Loader failed
For more detailed log messages, check the generated log file '/Users/chack/Documents/Documents - Charles’s MacBook Pro/engineering/meltano-projects/baton-elt/baton-elt/.meltano/logs/elt/2022-02-23T181715--tap-hellobaton--target-bigquery/5810295c-53a4-4d36-a4a2-4f1274371656/elt.log' or re-run the command using the '--log-level=debug' CLI flag.
2022-02-23T18:17:22.940754Z [error    ] Future exception was never retrieved
future: <Future finished exception=BrokenPipeError(32, 'Broken pipe')> 
Traceback (most recent call last):
  File "/Users/chack/anaconda3/lib/python3.8/asyncio/unix_events.py", line 687, in _write_ready
    n = os.write(self._fileno, self._buffer)
BrokenPipeError: [Errno 32] Broken pipe

@dluftspring
Copy link
Owner

@hack-c im trying to get to the bottom of this but it looks like a bug with the target. It's trying to parse a message of type RECORD as a record of type SCHEMA which is causing a KeyError. I'm not sure why though will let you know what I figure out. Were you able to test and see if @marknotfound's changes solve the issue?

@hack-c
Copy link

hack-c commented Feb 24, 2022

Thanks so much for your help on this @dluftspring . In order to test it, would I just update the git URL in the meltano.yml to point to this branch / commit and re-add the loader ?

@hack-c
Copy link

hack-c commented Feb 24, 2022

I reinstalled from @marknotfound 's fork and if failed with the same error :/ sorry @marknotfound

(baton-elt) ➜  baton-elt meltano --log-level=debug elt tap-hellobaton target-bigquery
[...]
2022-02-24T18:13:10.848460Z [error    ] Loading failed                 code=2 job_id=2022-02-24T181306--tap-hellobaton--target-bigquery message=CRITICAL ['Traceback (most recent call last):\n', '  File "/Users/chack/Documents/Documents - Charles’s MacBook Pro/engineering/meltano-projects/baton-elt/baton-elt/.meltano/loaders/target-bigquery/venv/lib/python3.8/site-packages/target_bigquery/__init__.py", line 129, in main\n    for state in state_iterator:\n', '  File "/Users/chack/Documents/Documents - Charles’s MacBook Pro/engineering/meltano-projects/baton-elt/baton-elt/.meltano/loaders/target-bigquery/venv/lib/python3.8/site-packages/target_bigquery/process.py", line 54, in process\n    for s in handler.handle_record_message(msg):\n', '  File "/Users/chack/Documents/Documents - Charles’s MacBook Pro/engineering/meltano-projects/baton-elt/baton-elt/.meltano/loaders/target-bigquery/venv/lib/python3.8/site-packages/target_bigquery/processhandler.py", line 179, in handle_record_message\n    nr = format_record_to_schema(nr, self.bq_schema_dicts[stream])\n', '  File "/Users/chack/Documents/Documents - Charles’s MacBook Pro/engineering/meltano-projects/baton-elt/baton-elt/.meltano/loaders/target-bigquery/venv/lib/python3.8/site-packages/target_bigquery/schema.py", line 359, in format_record_to_schema\n    record[k] = conversion_dict[bq_schema[k]["type"]](v)\n', "KeyError: 'RECORD'\n"] name=meltano run_id=fc06d421-0dac-48c0-aab1-62ad0c855aad
2022-02-24T18:13:10.848955Z [debug    ] ELT could not be completed: Loader failed
For more detailed log messages, check the generated log file '/Users/chack/Documents/Documents - Charles’s MacBook Pro/engineering/meltano-projects/baton-elt/baton-elt/.meltano/logs/elt/2022-02-24T181306--tap-hellobaton--target-bigquery/fc06d421-0dac-48c0-aab1-62ad0c855aad/elt.log' or re-run the command using the '--log-level=debug' CLI flag. 
Traceback (most recent call last):
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/cli/elt.py", line 243, in _run_elt
    await _run_extract_load(log, elt_context, output_logger)
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/cli/elt.py", line 303, in _run_extract_load
    await singer_runner.run(
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/core/runner/singer.py", line 224, in run
    await self.invoke(
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/core/runner/singer.py", line 206, in invoke
    raise RunnerError("Loader failed", {PluginType.LOADERS: target_code})
meltano.core.runner.RunnerError: Loader failed

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/cli/elt.py", line 231, in _redirect_output
    yield
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/cli/elt.py", line 252, in _run_elt
    raise CliError(
meltano.cli.utils.CliError: ELT could not be completed: Loader failed
For more detailed log messages, check the generated log file '/Users/chack/Documents/Documents - Charles’s MacBook Pro/engineering/meltano-projects/baton-elt/baton-elt/.meltano/logs/elt/2022-02-24T181306--tap-hellobaton--target-bigquery/fc06d421-0dac-48c0-aab1-62ad0c855aad/elt.log' or re-run the command using the '--log-level=debug' CLI flag.
2022-02-24T18:13:10.851674Z [info     ] ELT could not be completed: Loader failed cmd_type=elt job_id=2022-02-24T181306--tap-hellobaton--target-bigquery name=meltano run_id=fc06d421-0dac-48c0-aab1-62ad0c855aad stdio=stderr
2022-02-24T18:13:10.851913Z [info     ] For more detailed log messages, check the generated log file '/Users/chack/Documents/Documents - Charles’s MacBook Pro/engineering/meltano-projects/baton-elt/baton-elt/.meltano/logs/elt/2022-02-24T181306--tap-hellobaton--target-bigquery/fc06d421-0dac-48c0-aab1-62ad0c855aad/elt.log' or re-run the command using the '--log-level=debug' CLI flag. cmd_type=elt job_id=2022-02-24T181306--tap-hellobaton--target-bigquery name=meltano run_id=fc06d421-0dac-48c0-aab1-62ad0c855aad stdio=stderr
2022-02-24T18:13:10.858970Z [debug    ] ELT could not be completed: Loader failed
For more detailed log messages, check the generated log file '/Users/chack/Documents/Documents - Charles’s MacBook Pro/engineering/meltano-projects/baton-elt/baton-elt/.meltano/logs/elt/2022-02-24T181306--tap-hellobaton--target-bigquery/fc06d421-0dac-48c0-aab1-62ad0c855aad/elt.log' or re-run the command using the '--log-level=debug' CLI flag. 
Traceback (most recent call last):
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/cli/elt.py", line 243, in _run_elt
    await _run_extract_load(log, elt_context, output_logger)
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/cli/elt.py", line 303, in _run_extract_load
    await singer_runner.run(
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/core/runner/singer.py", line 224, in run
    await self.invoke(
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/core/runner/singer.py", line 206, in invoke
    raise RunnerError("Loader failed", {PluginType.LOADERS: target_code})
meltano.core.runner.RunnerError: Loader failed

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/cli/__init__.py", line 47, in main
    cli(obj={"project": None})
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/cli/params.py", line 23, in decorate
    return func(*args, **kwargs)
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/cli/params.py", line 56, in decorate
    func(project, *args, **kwargs)
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/core/utils/__init__.py", line 71, in wrapper
    return run_async(func(*args, **kwargs))
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/core/utils/__init__.py", line 50, in run_async
    loop.run_until_complete(future)
  File "/Users/chack/anaconda3/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/cli/elt.py", line 133, in elt
    await _run_job(project, job, session, context_builder, force=force)
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/cli/elt.py", line 215, in _run_job
    await _run_elt(log, context_builder, output_logger)
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/cli/elt.py", line 252, in _run_elt
    raise CliError(
meltano.cli.utils.CliError: ELT could not be completed: Loader failed
For more detailed log messages, check the generated log file '/Users/chack/Documents/Documents - Charles’s MacBook Pro/engineering/meltano-projects/baton-elt/baton-elt/.meltano/logs/elt/2022-02-24T181306--tap-hellobaton--target-bigquery/fc06d421-0dac-48c0-aab1-62ad0c855aad/elt.log' or re-run the command using the '--log-level=debug' CLI flag.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/chack/anaconda3/lib/python3.8/site-packages/meltano/cli/__init__.py", line 55, in main
    raise CliError(str(err)) from err
meltano.cli.utils.CliError: ELT could not be completed: Loader failed
For more detailed log messages, check the generated log file '/Users/chack/Documents/Documents - Charles’s MacBook Pro/engineering/meltano-projects/baton-elt/baton-elt/.meltano/logs/elt/2022-02-24T181306--tap-hellobaton--target-bigquery/fc06d421-0dac-48c0-aab1-62ad0c855aad/elt.log' or re-run the command using the '--log-level=debug' CLI flag.
ELT could not be completed: Loader failed
For more detailed log messages, check the generated log file '/Users/chack/Documents/Documents - Charles’s MacBook Pro/engineering/meltano-projects/baton-elt/baton-elt/.meltano/logs/elt/2022-02-24T181306--tap-hellobaton--target-bigquery/fc06d421-0dac-48c0-aab1-62ad0c855aad/elt.log' or re-run the command using the '--log-level=debug' CLI flag.
2022-02-24T18:13:10.905116Z [error    ] Future exception was never retrieved
future: <Future finished exception=BrokenPipeError(32, 'Broken pipe')> 
Traceback (most recent call last):
  File "/Users/chack/anaconda3/lib/python3.8/asyncio/unix_events.py", line 687, in _write_ready
    n = os.write(self._fileno, self._buffer)
BrokenPipeError: [Errno 32] Broken pipe

@hack-c
Copy link

hack-c commented Feb 24, 2022

here's my meltano.yml for the record...

(baton-elt) ➜  baton-elt cat meltano.yml 
version: 1
send_anonymous_usage_stats: true
project_id: c417c22a-fb9a-4e0d-8f28-69d2cb1d2671
plugins:
  extractors:
  - name: tap-hellobaton
    namespace: tap_hellobaton
    pip_url: git+https://github.com/marknotfound/tap-hellobaton.git
    executable: tap-hellobaton
    capabilities:
    - catalog
    - state
    - discover
    settings:
    - name: company
      kind: string
    - name: api_key
      kind: password
    - name: user_agent
      kind: string
    config:
      company: mantl
      user_agent: Singer Tap for hellobaton
    load_schema: baton
  loaders:
  - name: target-bigquery
    variant: adswerve
    pip_url: git+https://github.com/adswerve/[email protected]
    config:
      project_id: mantl-edw-datalake-production
      dataset_id: baton
  - name: target-jsonl
    variant: andyh1203
    pip_url: target-jsonl

@dluftspring
Copy link
Owner

dluftspring commented Feb 24, 2022

@hack-c are you using a catalogue when you sync records?

Sorry this is taking a while to track down. I think the issue is with how the target handles nested JSON. So in cases where the schema declares a type as ['object', 'null'] there is supposed to be some recursion that i think is breaking when the API returns an empty result. Will keep digging and see if I can come up with a workaround

@dluftspring
Copy link
Owner

@marknotfound in the activity endpoint what type is meta supposed to be? It consistently sends me an empty dictionary but on the docs it's listed as a string. I think the issue is that target-bigquery can't handle cases where a field is listed as an object but does not have specified property types in the json blob or nested structure. The fix to this may be as simple as casting the field to a string in transit or updating the type definition in the json schema

@marknotfound
Copy link
Author

marknotfound commented Feb 24, 2022 via email

@dluftspring
Copy link
Owner

dluftspring commented Feb 24, 2022

Does it have a set of valid properties or do they change based on the event? If it does then I just need to include them in the json schema with proper typing Yeah I see it's dyanmic

@dluftspring
Copy link
Owner

dluftspring commented Feb 25, 2022

Okay so after some investigation I think the issue is definitely with the meta field within the activity endpoint. @hack-c here are some things to try (I don't have easy access to a BQ test environment or i'd do these myself).

  1. Use the force fields option to cast meta to a string
  2. Use a catalogue to unselect the meta field altogether
  3. I'll make a PR that casts the meta field to a string type (even though it's a jsonb) in transit and then any downstream work will have to be done in the warehouse.

UPDATE: You can also try pulling from the branch on PR #10

@hack-c
Copy link

hack-c commented Feb 25, 2022 via email

@hack-c
Copy link

hack-c commented Feb 25, 2022

OMG ! @dluftspring the first option worked ! forcing the meta to be a string. thank you guys SO MUCH for your help on this. I think we can safely close this PR.

@dluftspring
Copy link
Owner

🎸 woohoo! any chance you can see if #10 solves it as well? I'd rather have something that works for everyone but if not i'll close the PRs and update the README with a call out for bigquery users

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when using with target-bigquery
3 participants