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: check length of args of python model function before accessing it #6042

Merged
merged 3 commits into from
Oct 11, 2022

Conversation

chamini2
Copy link
Contributor

@chamini2 chamini2 commented Oct 10, 2022

resolves #6041

Description

Check the number of arguments in the python model being parsed before checking if the first one is a variable named dbt

Checklist

@cla-bot cla-bot bot added the cla:yes label Oct 10, 2022
Copy link
Contributor

@ChenyuLInx ChenyuLInx left a comment

Choose a reason for hiding this comment

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

LGTM. @chamini2 Thanks for the quick patch! There are some unit tests here, do you mind add one for this case? And maybe a change log

@chamini2 chamini2 marked this pull request as ready for review October 11, 2022 20:08
@chamini2 chamini2 requested review from a team as code owners October 11, 2022 20:08
@chamini2 chamini2 requested a review from emmyoop October 11, 2022 20:08
@ChenyuLInx ChenyuLInx merged commit dcd6ef7 into dbt-labs:main Oct 11, 2022
@ChenyuLInx
Copy link
Contributor

@chamini2 Thanks for catching this and fix it!

ChenyuLInx pushed a commit that referenced this pull request Oct 11, 2022
#6042)

* fix: check length of args of python model function before accessing it

* Add test

* changie

(cherry picked from commit dcd6ef7)
leahwicz pushed a commit that referenced this pull request Oct 11, 2022
#6042) (#6049)

* fix: check length of args of python model function before accessing it

* Add test

* changie

(cherry picked from commit dcd6ef7)

Co-authored-by: Matteo Ferrando <matteo.ferrando2@gmail.com>
@chamini2 chamini2 deleted the parse-model branch October 12, 2022 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CT-1326] [Bug] Python model with no arguments in the function raises index our of range exception
3 participants