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

Quotes in strings with dates should not be needed #37

Open
jgbarah opened this issue Jan 3, 2014 · 2 comments
Open

Quotes in strings with dates should not be needed #37

jgbarah opened this issue Jan 3, 2014 · 2 comments

Comments

@jgbarah
Copy link
Member

jgbarah commented Jan 3, 2014

We're having some weird way of specifying strings with dates. Usually, a string with a date should be something like "2013-12-31". However, in some cases, we have to use "'2013-12-31'" (note the backslash-quote as a part of the string).

An example is the argument startdate (and enddate) for GetSCMEvolutionaryData.

This seems to be due to some lower functions needing the quotes in the string to compose queries for the database. I've traced this to at least two functions: GetSQLPeriod and GetSQLGlobal in Auxiliary.R. Instead of adding the quotes themselves (they are needed to compose the SQL queries), they relay on the parameters already having the quotes.

My proposal is that we should avoid all of this, since it is weird, difficult to explain, error-prone and probably has only historical reasons. Dates should always be strings, with no need for extra quotes.

However, this could break scripts calling all these functions, so the change should be done with care. As soon as I have some time, I could produce a patch for this. But meanwhile, opinions are welcome.

@acs
Copy link
Member

acs commented Jan 4, 2014

Yes, we should avoid all of this. +1

@dicortazar
Copy link
Member

This is also happening in the case of companies or domains names... some inherited stuff I'm afraid...

So yes, +1

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

No branches or pull requests

3 participants