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

Make Column Names Comparison Case Insensitive #234

Closed
adamsma opened this issue Aug 25, 2021 · 6 comments
Closed

Make Column Names Comparison Case Insensitive #234

adamsma opened this issue Aug 25, 2021 · 6 comments

Comments

@adamsma
Copy link

adamsma commented Aug 25, 2021

My database transforms all column names to lower case. This causes a failure when comparing to generated tables with upper case letters, i.e. iris dataset. I'm not sure how this affects all the other tests but options could be:

  1. in get_iris change all columns to lower case
    names(datasets_iris) <- tolower(names(datasets_iris))
  2. make similar transformation to lower case for all data.frame comparisons
  3. use testthat::expected_equivalent which ignores attributes
  4. allow for tweak that makes column names lower case
@krlmlr
Copy link
Member

krlmlr commented Aug 26, 2021

Thanks for raising this. What database are you using?

The most straightforward way would be to use lowercase column names as a rule, and have one or two tests for case preservation, which would be omitted/skipped in your case.

@adamsma
Copy link
Author

adamsma commented Aug 27, 2021

I'm interfacing with Trino. Ultimately, the data is stored in AWS S3, but I believe it's Trino that imposes this requirement. Currently, my workaround is I've added a trace within my test setup that adds option 1.

@krlmlr
Copy link
Member

krlmlr commented Sep 6, 2021

Thanks, interesting. Are you using odbc to interface with Trino? What's the easiest way to get access to, or deploy, an installation of Trino for testing?

This looks related to #155, can you confirm?

@krlmlr
Copy link
Member

krlmlr commented Sep 12, 2021

Amazon RedShift has the same feature/limitation. We could add a tweak that defines transformations to column names, or use only lowercase column names.

@krlmlr
Copy link
Member

krlmlr commented Sep 13, 2021

Closed in #243.

@krlmlr krlmlr closed this as completed Sep 13, 2021
@github-actions
Copy link

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants