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

improve error message when column is not found #3166

Merged
merged 1 commit into from
Sep 20, 2022
Merged

Conversation

bkamins
Copy link
Member

@bkamins bkamins commented Sep 19, 2022

Following discussion on Slack.

After the change:

julia> df = DataFrame()
0×0 DataFrame

julia> df.a
ERROR: ArgumentError: column name "a" not found in the data frame since it has no columns

julia> df = DataFrame(a=1, b=2, c=3)
1×3 DataFrame
 Row │ a      b      c     
     │ Int64  Int64  Int64 
─────┼─────────────────────
   1 │     1      2      3

julia> df.d
ERROR: ArgumentError: column name "d" not found in the data frame; existing most similar names are: "a", "b" and "c"

I use string quoting not : and backticks as suggested on Slack as we allow string as column name.

@bkamins bkamins added this to the 1.4 milestone Sep 19, 2022
@bkamins bkamins removed the request for review from nalimilan September 20, 2022 06:05
@bkamins bkamins merged commit ed41652 into main Sep 20, 2022
@bkamins bkamins deleted the bk/fix_error_col branch September 20, 2022 06:05
@bkamins
Copy link
Member Author

bkamins commented Sep 20, 2022

Thank you!

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

Successfully merging this pull request may close these issues.

2 participants