Skip to content

ETL: Modified canonical description to ease test suite generation #1485

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

Closed
wants to merge 1 commit into from

Conversation

macta
Copy link
Contributor

@macta macta commented Mar 22, 2019

Small change to the json spec that is easier for code generation, and clearly shows that you are calling the etl function with 1 parameter (which has "1"..."x" tile arrays)

@macta
Copy link
Contributor Author

macta commented Mar 22, 2019

Also - the use of a nested case was redundant, they were essentially all top level.

@rpottsoh rpottsoh changed the title Modified etl canonical description to be generatable ETL: Modified canonical description to ease test suite generation Mar 22, 2019
"description": "transforms a single letter",
"property": "transform",
"input": {
"data" : {"1": ["A"]}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does inserting "data" between "input" and the actual data make things easier?

Copy link
Contributor Author

@macta macta Mar 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strictly by definition (and if automatically generating the tests), each input translates as a new parameter to a function - so the previous data is confusing - you end up with a function that takes :

Transform(input1: x, input2: y, input 3: z etc)... which is not the intent of the exercise.

Contrast this with other exercises where the function genuinely has these parameters - eg

calculateArea(width:5, length: 10).

The last test for this etl exercise drives it home (with so many inputs). It’s inconsistent with other exercises as previously defined. And if you look at how other languages have manually translated it - they all pass a single dictionary as the input.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ErikSchierboom , I'm wondering if you have any comment on this one too - as presumably you might have hit this inconsistency when generating exercises from the spec too? I notice that Etl in C# also calls a single function and passes a single dictionary with "1" and "2" as keys.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@macta You are correct that in principle, it would be slightly easier to have the inputs grouped into a single parameter.

@petertseng
Copy link
Member

Also - the use of a nested case was redundant, they were essentially all top level.

The "Also" there implies to me that this PR should be two commits, one for removing the extra nesting and one for adding "data". However, it appears that others are happy to review it as one commit, so I see I am not productively contributing to this conversation and will stop harping on this immediately.

@@ -1,77 +1,76 @@
{
"exercise": "etl",
"version": "1.0.0",
"version": "1.0.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the correct next version. Changing the input like this is not backwards compatible, so should probably be "2.0.0".

@petertseng
Copy link
Member

this was done in the linked PR

@petertseng petertseng closed this Jul 20, 2019
@petertseng petertseng deleted the etl-improvement-for-better-code-generation branch July 20, 2019 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants