Skip to content
This repository has been archived by the owner on Nov 19, 2021. It is now read-only.

option to retain natural capitalization #58

Open
ausiddiqui opened this issue Aug 24, 2018 · 4 comments
Open

option to retain natural capitalization #58

ausiddiqui opened this issue Aug 24, 2018 · 4 comments

Comments

@ausiddiqui
Copy link

Is there a way to maintain the capitalization after querying and storing off of a select statement. This becomes an issue as Python is case sensitive, so the response from the query ends up in a dataframe where something was expected to be fiscalYear but ends up being stored as fiscalyear.

Would there be a way to add this as an overall option to set for the package or for specific modules, whichever is easier?

@ChrisRx
Copy link
Contributor

ChrisRx commented Aug 28, 2018

An option to maintain the case sensitivity would be a good one to add. The issue we experienced was that for some [insane] reason (presumably to support Windows as a client platform), Teradata server can maintain case sensitivity while operating against namespaces with case insensitivity. The decision to make a "safe" name for accessing this in Python was driven by the possibility (and, in our experience, reality) that people would create tables/columns with seemingly arbitrary casing and that this would break down interactions with these objects via giraffez. With all the names changed predictably we thought it would help to address this use case. In the situation it would not, it definitely makes sense to add an option to maintain capitalization. My naive implementation would say that setting the operating mode for case sensitivity should be set at the package/module level (and therefore apply globally for that Python interpreter), but I'm open to other ideas/submissions on how to solve this issue.

@ausiddiqui
Copy link
Author

Yeah, I agree a package level option would be good enough for those who wish to maintain cases in their code, rather than for each function call.

@ausiddiqui ausiddiqui reopened this Oct 3, 2018
@ausiddiqui
Copy link
Author

Any idea where to get started on this? If it is native Python I can try forking and trying it out on my own, just would need some guidance on a few places and docs to read up on.

@ChrisRx
Copy link
Contributor

ChrisRx commented Nov 6, 2018

I'm not 100% sure, but I think it would only require removing the .lower() call here and then here in the C extension, to preserve the case everywhere else. The C encoder is where this all takes place and it always uses whatever is set for the column Title when naming fields.

I would start there and I think it should probably be both a global setting, that could be set via Config and stored in the .girafferc and a named parameter for both Cmd and BulkExport. Once you get to that point I can help out with that as well. I would try it myself but I currently do not have access to a Teradata server that I could actually try it (hopefully will be able to change that soon).

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

No branches or pull requests

2 participants