Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last nit: It this if statement necessary? I think
rstrip
on an empty string will produce an empty string.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, but I added it because you don't want to add a key to the dict if it doesn't already have it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though, generally, I'm not actually sure why this is located here, because it seems like it'd be more natural to handle it in prepare_target_name().
On a similar note, I think subtracting 1 from num_partition_keys here, but actually removing the "date" partition key in prepare_target_name(), might be a little risky. Could they be done in the same place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that makes sense.
I agree – this would be a better fit: It'd be best if the parser had less logic, in general.
Yes, that totally sounds right to me.
Last: I think we are no longer using the
num_partition_keys
counter anymore. It would be prudent to pull that out.