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

[fix] br_ms_cnes.estabelecimento #507

Closed
laura-l-amaral opened this issue Mar 19, 2024 · 0 comments · Fixed by #513
Closed

[fix] br_ms_cnes.estabelecimento #507

laura-l-amaral opened this issue Mar 19, 2024 · 0 comments · Fixed by #513
Assignees

Comments

@laura-l-amaral
Copy link
Contributor

laura-l-amaral commented Mar 19, 2024

  • log do erro
Flow 'Materialize <Parameter: dataset_id>.<Parameter: table_id>': Task 'run_dbt_model': Exception encountered during task execution!
Traceback (most recent call last):
  File "/opt/venv/lib/python3.10/site-packages/prefect/engine/task_runner.py", line 876, in get_task_run_state
    value = prefect.utilities.executors.run_task_with_timeout(
  File "/opt/venv/lib/python3.10/site-packages/prefect/utilities/executors.py", line 454, in run_task_with_timeout
    return task.run(*args, **kwargs)  # type: ignore
  File "/home/runner/work/pipelines/pipelines/pipelines/utils/execute_dbt_model/tasks.py", line 111, in run_dbt_model
  File "/opt/venv/lib/python3.10/site-packages/dbt_client/dbt_client.py", line 270, in cli
    return self._run_sync(
  File "/opt/venv/lib/python3.10/site-packages/dbt_client/dbt_client.py", line 223, in _run_sync
    raise Exception(
Exception: Error running sync command: Database Error in model br_ms_cnes__estabelecimento (models/br_ms_cnes/br_ms_cnes__estabelecimento.sql)
  Failed to parse input string "nan"
  compiled Code at target/run/basedosdados/models/br_ms_cnes/br_ms_cnes__estabelecimento.sql
  • link da run

  • motivo: ocorre quando uma função ou tipo do bigquery que não aceita strings possui um valor 'nan'. Nesse caso, alguns valores de data e colunas de tipo int64 estavam preenchidos com nan o que quebrava a materialização.

  • soluçao: Basta inserir o safe_cast para converter tais valores para nulo.

@laura-l-amaral laura-l-amaral converted this from a draft issue Mar 19, 2024
@laura-l-amaral laura-l-amaral moved this from 📋 A refinar to 🏁 Priorizado in Roadmap de dados Mar 19, 2024
@folhesgabriel folhesgabriel linked a pull request Mar 20, 2024 that will close this issue
@github-project-automation github-project-automation bot moved this from 🏁 Priorizado to ✅ Finalizada! in Roadmap de dados Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Finalizada!
Development

Successfully merging a pull request may close this issue.

2 participants