Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Hello, quick question about one of the hard coded test examples.
DB[:campaign_sends].multi_insert([
current send - baseline
{ user_id: 1, sent_at: '2023-01-08 08:00:00', campaign_id: 'new_year', channel: 'email' },
exactly 7 days ago --> should count as prior touch
{ user_id: 1, sent_at: '2023-01-01 08:00:00', campaign_id: 'new_year', channel: 'sms' },
7 days + 1 second after (2023-01-01 08:00:01) --> too late, outside the window
{ user_id: 1, sent_at: '2023-01-01 08:00:01', campaign_id: 'new_year', channel: 'push' },
same moment as current send --> does not count as prior
{ user_id: 1, sent_at: '2023-01-08 08:00:00', campaign_id: 'new_year', channel: 'sms' },
valid message 1 hour before --> valid prior
{ user_id: 1, sent_at: '2023-01-08 07:00:00', campaign_id: 'new_year', channel: 'push' }
])
In the "Check Windows" section of the tests your third row example { user_id: 1, sent_at: '2023-01-01 08:00:01', campaign_id: 'new_year', channel: 'push' }, says above it "7 days + 1 second after" and that it shouldn't be counted as a prior but isn't '2023-01-01 08:00:01' actually 6 days, 23 hours, 59 minutes and 59 seconds before the baseline which is '2023-01-08 08:00:00'?
description says
but in the tests expected output for a random test seem to be sorted just by channel:
it's hard to figure out from description whether there could be several 'converted' events for the same user
description says
but it is not clear for me do you mean data in campaign_sends or in engagement_events or both, as that rows could have different timestamps in different fields
The description for what constitutes a
GROUP_OTHERS
username is unclear. Specification should say "followed by 1 or more digits and no non-digit characters" instead of "followed only by digits", as one could argue that the usernameUser
is followed only by digits, even though it's0
of them.The specification doesn't say which way the cycles should go. If they were reversed, that would also be a correct solution, yet probably failing the tests.
What @Dmitry-k42 described is actually an issue. Category names are used in the tests not only for tie breaking at the last (5th) places, but also for ordering the otherwise tied rows in the result. See my solution. The description (updated after @Volie's issue) requires the
"name"
in the innerORDER BY
clause, but not the outer. Yet, the order of such rows is arbitrary without it, which may fail your tests.The description of kata is ambiguous - it says: "return a list of users and their pet names, but only for users who have at least one pet whose name starts with the letter 'M'." It doesn't say that we should exclude all pet names which doesn't start with 'M'. According to description we should return all users and all their pet names in case if at least one pet name starts with 'M' for a giver user.
This comment is hidden because it contains spoiler information about the solution
In the random tests, it is possible for two persosn to be tied by number of rentals AND by last name. The bug can be easily replicated by adding
random()
as a third sorting criterion (which normally should not change the results if the first two criteria were enough).the link to the DVD rental database in the description is dead.
postgresqltutorial.com
now redirects toneon.tech
which is a commercial website, though you can still download the DB for free from therethe link to the DVD rental database in the description is dead.
postgresqltutorial.com
now redirects toneon.tech
which is a commercial website, though you can still download the DB for free from thereThe instructions say that 'call_hour' should be an int but the tests fail as they want the 'call_hour' to be a float.
I can't complete as I'm getting this error: ./spec/query_spec.rb:169:in
block in format_output': undefined method
ljust' for nil:NilClass (NoMethodError)Any idea what is going on?
Expected values
2nd level sorting order is to be the rental date, so I think this should better be sorted be the actual dates, not the strings, otherwise Nov 11th will be shown as "later" than Dec 12th.
My solution is passing without accounting for leap years, and I think that is ok for a beginner level kata.
If so, maybe you could change this date for the last sample test entry to 367?
--> host_software.insert(host: 'backup_server_1', software_title: 'Title1', install_date: Date.today - 366)
You could add to the description that "percentage of orders" only refers to the count of processed orders here, not to the combined total orders.
Loading more items...