VizGrimoire / VizGrimoireR

R Library to analyze data gathered from Metrics Grimoire and others
14 stars 10 forks source link

Quotes in strings with dates should not be needed #37

Open jgbarah opened 10 years ago

jgbarah commented 10 years ago

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 commented 10 years ago

Yes, we should avoid all of this. +1

dicortazar commented 10 years ago

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

So yes, +1