-
Notifications
You must be signed in to change notification settings - Fork 61
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
Reference Previous Rows #221
Comments
Thanks for filing this issue. By design, the values for a given row do not depend on the previous row. This is to enable highly scalable parallelism. However you could compute the combination of dates, hotels and room ids based on some other intermediate values to guarantee non overlap. Alternatively you could generate the data as you do in the example above and filter out conflicting data using where clauses on the data frame resulting from build. To use the filtering approach, you would need to expand the records for date range, hotel and room id to produce one row for each day and then drop duplicates. You can then roll up the resulting data to produce the new date ranges. I have some additional features in development regarding modelling more complex timing events - but it wont necessarily address this specific issue. |
Do you have some code that you can share so that i can repro what you are doing ? |
Expected Behavior
When generating date ranges, avoid overlapping ranges with previous rows.
Current Behavior
I have read and followed the articles here: https://databrickslabs.github.io/dbldatagen/public_docs/DATARANGES.html?highlight=previous+rows & here https://databrickslabs.github.io/dbldatagen/public_docs/reference/api/dbldatagen.column_generation_spec.html?highlight=basecolumns#dbldatagen.column_generation_spec.ColumnGenerationSpec.baseColumns
Current output:
Basically the next row values for date_start & end should be created based on the previous rows values to avoid overlaps.
Steps to Reproduce (for bugs)
Generate synthetic data for a hotel booking system with fields Hotel_name, room_number, room_status, start_date, end_date.
Context
Specific use case - generate synthetic data for hotel bookings. Logically you cannot have 2 or more rows with the same hotel_name,room_number, start_date and different or same room_status (available, booked, reserved). I am trying to find a mechanism to first check previous rows, and when assigning the room_status ensure that room_number, hotel, date_start, date_end does not overlap.
Your Environment
dbldatagen
version used:dbldatagen-0.3.4.post2The text was updated successfully, but these errors were encountered: