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

Disallow Vector{Union{String, Symbol}} to have both types in a single vector #194

Open
siddjain444 opened this issue Apr 16, 2024 · 1 comment · May be fixed by #197
Open

Disallow Vector{Union{String, Symbol}} to have both types in a single vector #194

siddjain444 opened this issue Apr 16, 2024 · 1 comment · May be fixed by #197
Assignees

Comments

@siddjain444
Copy link
Contributor

siddjain444 commented Apr 16, 2024

This signature is used in many getindex() functions. There are two options to solve this:

  • Create separate functions to handle Symbol and String types respectively.
  • Throw an error if both types are present in the input argument. This is what DataFrames.jl does.
@chiraganand chiraganand changed the title getindex function to handle the vector of row names passed as union of string and symbol Disallow Vector{Union{String, Symbol}} to have both types in a single vector Apr 17, 2024
@chiraganand
Copy link
Member

* Throw an error if both types are present in the input argument. This is what DataFrames.jl does.

My preference is with this because it will be easier to maintain by having less number of functions which behave exactly same except for the argument type. Plus, DataFrames.jl also follows the same approach so it is better to be consistent.

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