question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dbt=0.20.0-rc1 on postgres throws "maximum recursion depth exceeded while calling a Python object" error

See original GitHub issue

Describe the bug

Hi folks! Not sure what I gunked up, but this PR to update dbt-expectations to 0.20.0 currently won’t run against my postgres target but works fine against BigQuery and Snowflake.

integration_tests git:(fix/dbt-0.20.0-compatibility) dbt run -t postgres
Running with dbt=0.20.0-rc1
Encountered an error:
maximum recursion depth exceeded while calling a Python object

Steps To Reproduce

Probably the best way is to check out the PR, then cd integration_tests and run dbt run -t postgres where postgres is one of the targets in your integration_tests profile. I’m running PostgreSQL 13 via the Mac Postgres app.

System information

Which database are you using dbt with?

  • postgres
  • redshift
  • bigquery
  • snowflake
  • other (specify: ____________)

The output of dbt --version:

installed version: 0.20.0-rc1
   latest version: 0.19.1

Your version of dbt is ahead of the latest release!

Plugins:
  - bigquery: 0.20.0rc1
  - snowflake: 0.20.0rc1
  - redshift: 0.20.0rc1
  - postgres: 0.20.0rc1

The operating system you’re using: mac OS Big Sur 11.2.1 (20D74)

The output of python --version: Python 3.8.1

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
clausherthercommented, Jun 8, 2021

Attaching logs… dbt.log

relevant lines (?)

File "/Users/claus/.pyenv/versions/3.8.1/envs/dbt020/lib/python3.8/site-packages/dbt/context/macro_resolver.py", line 154, in __init__
    self.recursively_get_depends_on_macros(depends_on_macros, dep_macros)
  File "/Users/claus/.pyenv/versions/3.8.1/envs/dbt020/lib/python3.8/site-packages/dbt/context/macro_resolver.py", line 176, in recursively_get_depends_on_macros
    self.recursively_get_depends_on_macros(macro.depends_on.macros, dep_macros)
  File "/Users/claus/.pyenv/versions/3.8.1/envs/dbt020/lib/python3.8/site-packages/dbt/context/macro_resolver.py", line 176, in recursively_get_depends_on_macros
    self.recursively_get_depends_on_macros(macro.depends_on.macros, dep_macros)
  File "/Users/claus/.pyenv/versions/3.8.1/envs/dbt020/lib/python3.8/site-packages/dbt/context/macro_resolver.py", line 176, in recursively_get_depends_on_macros
    self.recursively_get_depends_on_macros(macro.depends_on.macros, dep_macros)
  [Previous line repeated 973 more times]
  File "/Users/claus/.pyenv/versions/3.8.1/envs/dbt020/lib/python3.8/site-packages/dbt/context/macro_resolver.py", line 172, in recursively_get_depends_on_macros
    dep_macros.append(macro_unique_id)
1reaction
jtcohen6commented, Jun 8, 2021

@clausherther Gross! Thanks for the report. I just checked out your branch and reproduced the error. Here’s the relevant bit from the stacktrace:

  File "/usr/local/Cellar/dbt@0.20.0-rc1/0.20.0rc1_1/libexec/lib/python3.8/site-packages/dbt/parser/schemas.py", line 359, in _parse_generic_test
    self.render_test_update(node, config, builder)
  File "/usr/local/Cellar/dbt@0.20.0-rc1/0.20.0rc1_1/libexec/lib/python3.8/site-packages/dbt/parser/schemas.py", line 415, in render_test_update
    context = generate_test_context(
  File "/usr/local/Cellar/dbt@0.20.0-rc1/0.20.0rc1_1/libexec/lib/python3.8/site-packages/dbt/context/providers.py", line 1464, in generate_test_context
    ctx = TestContext(
  File "/usr/local/Cellar/dbt@0.20.0-rc1/0.20.0rc1_1/libexec/lib/python3.8/site-packages/dbt/context/providers.py", line 1426, in __init__
    self._build_test_namespace()
  File "/usr/local/Cellar/dbt@0.20.0-rc1/0.20.0rc1_1/libexec/lib/python3.8/site-packages/dbt/context/providers.py", line 1450, in _build_test_namespace
    macro_namespace = TestMacroNamespace(
  File "/usr/local/Cellar/dbt@0.20.0-rc1/0.20.0rc1_1/libexec/lib/python3.8/site-packages/dbt/context/macro_resolver.py", line 154, in __init__
    self.recursively_get_depends_on_macros(depends_on_macros, dep_macros)
  File "/usr/local/Cellar/dbt@0.20.0-rc1/0.20.0rc1_1/libexec/lib/python3.8/site-packages/dbt/context/macro_resolver.py", line 176, in recursively_get_depends_on_macros
    self.recursively_get_depends_on_macros(macro.depends_on.macros, dep_macros)
  File "/usr/local/Cellar/dbt@0.20.0-rc1/0.20.0rc1_1/libexec/lib/python3.8/site-packages/dbt/context/macro_resolver.py", line 176, in recursively_get_depends_on_macros
    self.recursively_get_depends_on_macros(macro.depends_on.macros, dep_macros)
  File "/usr/local/Cellar/dbt@0.20.0-rc1/0.20.0rc1_1/libexec/lib/python3.8/site-packages/dbt/context/macro_resolver.py", line 176, in recursively_get_depends_on_macros
    self.recursively_get_depends_on_macros(macro.depends_on.macros, dep_macros)
  [Previous line repeated 973 more times]
  File "/usr/local/Cellar/dbt@0.20.0-rc1/0.20.0rc1_1/libexec/lib/python3.8/site-packages/dbt/context/macro_resolver.py", line 172, in recursively_get_depends_on_macros
    dep_macros.append(macro_unique_id)
RecursionError: maximum recursion depth exceeded while calling a Python object

Given that this seems related to our changes to infer macro dependencies, which is also making its way into 0.19.2, I’m going to test with 0.19.2-rc2 and see if I can reproduce the same error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

dbt=0.20.0-rc1 on postgres throws "maximum recursion depth ...
Describe the bug Hi folks! ... dbt=0.20.0-rc1 on postgres throws "maximum recursion depth exceeded while calling a Python object" error # ...
Read more >
maximum recursion depth exceeded while calling a Python ...
I don't know whats wrong in self.area. when the line self._poly = to_shape(self.area) executes I get this error RuntimeError: maximum recursion ...
Read more >
Maximum recursion depth exceeded while calling ... - Webucator
When working with Python properties, you might find yourself getting a “maximum recursion depth exceeded while calling a Python object” error.
Read more >
Issue 42848: asyncio produces an unexpected traceback with ...
__getattribute__(name) RecursionError: maximum recursion depth exceeded while calling a Python object During handling of the above exception ...
Read more >
maximum recursion depth exceeded while calling a Python ...
RecursionError : maximum recursion depth exceeded while calling a Python object when i check further log it said this error:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found