Module 3, Assignment 2: Need clarification

The instructions specifically say:

Identify why the script fails to execute and fix the issue to generate outputs identical to data_example.csv and schedule_example.json

The keyword is identical.

The problem is that (I believe) ‘data_example.json’ has an error in it:

user_id,income_day,work_day_of_week,date_work,time_in,time_out,working_time
1,869,Monday,2024-03-01,2024-08-21 08:59:29,2024-08-21 15:55:52,0 days 06:56:23.000000000

date_work is clearly 2024-03-01 and matches the source from which it is derived – i.e., info.json. However, time_in and time_out only come into the system (from ‘info.json’) as time values but are then date/time values in the data_example.csv. Probably an artefact of the date that the data_example.csv was generated with a working solution because that solution had a bug which was it was supposed to only translate the time but it converted it to a date/time object, using the current date on which it executed. To duplicate this it would be necessary to munge (the worst kind of hackery) out solution to generate the same date portion.

SO, what exactly does identical mean in the assignment. The same format – i.e., column ordering and preserving the key values not including the bug I described? Or does it mean LITERALLY identical? As in cmp data.csv data_example.csv?

And to be clear, this question of identical also applies schedule.json where a working solution produces a list (a set in list form) where the contents are equal (Set1 == Set2) but the ordering of the items in the list is not equal to schedule_example.json.

Thanks.

–J

We need to fix the code to produce those files again, identical means to produce the contents of those files as they are there.

I don’t think there is a bug in the original solutions, nobody has reported any such thing before here and people seem to fix the issue without going into complexities.

I disagree. Semantically, you can’t assert: We need to fix the code to produce those files again…, and then immediately follow I don’t think there is a bug in the original solutions…. Those are conflicting statements.

That said, it turns out it doesn’t matter. I created a solution that fixes the output but does not introduce the bogus date (as per my previous post). And then I submitted. And it all passed with no problem. It can be reasonably concluded that the comparison by the grader does NOT do a line-by-line comparison, for either file, or my submission would have failed. Therefore the identical directive is ambiguous and confusing.

…nobody has reported any such thing before here and people seem to fix the issue without going into complexities.

Apparently I am not as bright as all the others.

Regards.

1 Like