Skip to content
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

Initial work for day of the week targeting #820

Merged
merged 7 commits into from
Feb 8, 2024
Merged

Conversation

ericholscher
Copy link
Member

Mostly just wanted initial feedback here before I finish this work up.
Does this approach look reasonable?

The other approach I considered was having days be either weekdays or weekends,
which might be cleaner, but thought the flexibility was more useful of having specific days.

Mostly just wanted initial feedback here before I finish this work up.
Does this approach look reasonable?

The other approach I considered was having `days` be either `weekdays` or `weekends`,
which might be cleaner, but thought the flexibility was more useful of having specific days.
@ericholscher ericholscher requested a review from a team as a code owner February 7, 2024 22:58
Copy link
Collaborator

@davidfischer davidfischer left a comment

Choose a reason for hiding this comment

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

The other approach I considered was having days be either weekdays or weekends,
which might be cleaner, but thought the flexibility was more useful of having specific days.

I think this is fine and I could conceivably see advertisers skipping Fridays or Mondays or something like that.

@@ -292,6 +293,10 @@ def filter_flight(self, flight):
if flight.weighted_clicks_needed_this_interval() <= 0:
return False

# Skip if the flight is not meant to show on these days
if not flight.show_to_day(timezone.now().strftime("%A").lower()):
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess locale will always be EN_US so this should just work.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, good point. You can also get it to return an int, and use that to map to the day, if we're worried about it.

@ericholscher ericholscher merged commit 6f77b2c into main Feb 8, 2024
1 check passed
@ericholscher ericholscher deleted the target-weekends branch February 8, 2024 21:41
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.

2 participants