You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def model(dbt):
import pandas as pd
❯ dbt run
21:26:46 [WARNING]: Deprecated functionality
The `source-paths` config has been renamed to `model-paths`. Please update your
`dbt_project.yml` configuration to reflect this change.
21:26:46 [WARNING]: Deprecated functionality
The `data-paths` config has been renamed to `seed-paths`. Please update your
`dbt_project.yml` configuration to reflect this change.
21:26:46 Running with dbt=1.4.0-a1
21:26:46 Encountered an error:
Parsing Error in model model_c (models/staging/model_c.py)
model functionshould have two args, `dbt` and a session to current warehouse
*****
def model():
import pandas as pd
❯ dbt run
21:29:26 [WARNING]: Deprecated functionality
The `source-paths` config has been renamed to `model-paths`. Please update your
`dbt_project.yml` configuration to reflect this change.
21:29:26 [WARNING]: Deprecated functionality
The `data-paths` config has been renamed to `seed-paths`. Please update your
`dbt_project.yml` configuration to reflect this change.
21:29:26 Running with dbt=1.4.0-a1
21:29:27 Encountered an error:
list index out of range
21:29:27 Traceback (most recent call last):
File ".../Projects/fal-ai/dbt-core/core/dbt/main.py", line 135, in main
results, succeeded = handle_and_check(args)
File ".../Projects/fal-ai/dbt-core/core/dbt/main.py", line 198, in handle_and_check
task, res = run_from_args(parsed)
File ".../Projects/fal-ai/dbt-core/core/dbt/main.py", line 245, in run_from_args
results = task.run()
File ".../Projects/fal-ai/dbt-core/core/dbt/task/runnable.py", line 453, in run
self._runtime_initialize()
File ".../Projects/fal-ai/dbt-core/core/dbt/task/runnable.py", line 161, in _runtime_initialize
super()._runtime_initialize()
File ".../Projects/fal-ai/dbt-core/core/dbt/task/runnable.py", line 94, in _runtime_initialize
self.load_manifest()
File ".../Projects/fal-ai/dbt-core/core/dbt/task/runnable.py", line 81, in load_manifest
self.manifest = ManifestLoader.get_full_manifest(self.config)
File ".../Projects/fal-ai/dbt-core/core/dbt/parser/manifest.py", line 219, in get_full_manifest
manifest = loader.load()
File ".../Projects/fal-ai/dbt-core/core/dbt/parser/manifest.py", line 349, in load
self.parse_project(
File ".../Projects/fal-ai/dbt-core/core/dbt/parser/manifest.py", line 477, in parse_project
parser.parse_file(block)
File ".../Projects/fal-ai/dbt-core/core/dbt/parser/base.py", line 414, in parse_file
self.parse_node(file_block)
File ".../Projects/fal-ai/dbt-core/core/dbt/parser/base.py", line 388, in parse_node
self.render_update(node, config)
File ".../Projects/fal-ai/dbt-core/core/dbt/parser/models.py", line 227, in render_update
self.parse_python_model(node, config, context)
File ".../Projects/fal-ai/dbt-core/core/dbt/parser/models.py", line 204, in parse_python_model
dbtValidator.visit(tree)
File ".../.pyenv/versions/3.8.13/lib/python3.8/ast.py", line 371, in visit
return visitor(node)
File ".../.pyenv/versions/3.8.13/lib/python3.8/ast.py", line 379, in generic_visit
self.visit(item)
File ".../.pyenv/versions/3.8.13/lib/python3.8/ast.py", line 371, in visit
return visitor(node)
File ".../Projects/fal-ai/dbt-core/core/dbt/parser/models.py", line 52, in visit_FunctionDef
if not node.args.args[0].arg == "dbt":
IndexError: list index out of range
chamini2
changed the title
[CT-1326] [Bug] <title>
[CT-1326] [Bug] Python model with no arguments in the function raises index our of range exception
Oct 10, 2022
Is this a new bug in dbt-core?
Current Behavior
Creating a Python model with a
model
function without any arguments ends in anlist index out of range
exception rather than a helpful message.Expected Behavior
It should give a helpful message about how Python model definitions should look.
Steps To Reproduce
dbt run
Relevant log output
Environment
Which database adapter are you using with dbt?
postgres
Additional Context
No response
The text was updated successfully, but these errors were encountered: