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

46 update run id to reflect the ccao package standard #47

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
165 changes: 162 additions & 3 deletions glue/sales_val_flagging.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
import pandas as pd
import pytz
import random
import re
import sys
from pyathena import connect
Expand Down Expand Up @@ -233,12 +234,170 @@ def finish_flags(df, start_date, manual_update):
]

# Create run_id
r = RandomWords()
random_word_id = r.get_random_word()

left = [
"activist",
"admiring",
"adoring",
"affectionate",
"agitated",
"amazing",
"angry",
"awesome",
"beautiful",
"blissful",
"bold",
"boring",
"brave",
"busy",
"charming",
"clever",
"cool",
"compassionate",
"competent",
"condescending",
"confident",
"cranky",
"crazy",
"dazzling",
"determined",
"distracted",
"dreamy",
"eager",
"ecstatic",
"elastic",
"elated",
"elegant",
"eloquent",
"epic",
"exciting",
"fancy-free",
"fervent",
"festive",
"flamboyant",
"focused",
"footloose",
"friendly",
"frosty",
"funny",
"gallant",
"gifted",
"goofy",
"gracious",
"great",
"happy",
"hardcore",
"heuristic",
"hopeful",
"hungry",
"infallible",
"inspiring",
"interesting",
"intelligent",
"jolly",
"jovial",
"keen",
"kind",
"laughing",
"loving",
"lucid",
"magical",
"malingering",
"mystifying",
"modest",
"musing",
"naughty",
"nervous",
"nice",
"nifty",
"nostalgic",
"objective",
"over-qualified",
"optimistic",
"peaceful",
"pedantic",
"pensive",
"practical",
"priceless",
"quirky",
"quizzical",
"rebellious",
"recursing",
"relaxed",
"reverent",
"romantic",
"sad",
"serene",
"sharp",
"silly",
"sleepy",
"stoic",
"strange",
"stupefied",
"suspicious",
"sweet",
"tender",
"thirsty",
"trusting",
"unruffled",
"upbeat",
"vibrant",
"vigilant",
"vigorous",
"wizardly",
"wonderful",
"xenodochial",
"youthful",
"zealous",
"zen",
]

# Honorary list of Data Department employees, interns, and fellows
right = [
"billy",
"sam",
"nicole",
"dan",
"manasi",
"gabe",
"patrick",
"carly",
"jacob",
"nathan",
"tristan",
"eric",
"tayun",
"kyra",
"mike",
"antonia",
"ida",
"ethan",
"sean",
"matt",
"liz",
"takuya",
"boni",
"maya",
"damani",
"iris",
"bowen",
"yuxin",
"christian",
"rina",
"rob",
"sam",
"irene",
"claire",
"jean",
"damon",
"michael",
]

random_words = random.choice(left) + "-" + random.choice(right)
timestamp = datetime.datetime.now(pytz.timezone("America/Chicago")).strftime(
"%Y-%m-%d_%H:%M"
)
run_id = timestamp + "-" + random_word_id
run_id = timestamp + "-" + random_words

# Control flow for incorporating versioning
dynamic_assignment = {
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ resource "aws_glue_job" "sales_val_flagging" {
"--rolling_window_num" = 12
"--time_frame_start" = "2014-01-01"
"--dev_bounds" = "2,3"
"--additional-python-modules" = "Random-Word==1.0.11,boto3==1.28.12,pandas==2.0.2"
"--additional-python-modules" = "boto3==1.28.12,pandas==2.0.2"
"--commit_sha" = var.commit_sha
"--min_groups_threshold" = "30"
"--ptax_sd" = "1,1"
Expand Down
1 change: 0 additions & 1 deletion manual_flagging/initial_flagging.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import yaml
from pyathena import connect
from pyathena.pandas.util import as_pandas
from random_word import RandomWords

# Set working dir to manual_update, standardize yaml and src locations
root = sp.getoutput("git rev-parse --show-toplevel")
Expand Down
1 change: 0 additions & 1 deletion manual_flagging/manual_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import yaml
from pyathena import connect
from pyathena.pandas.util import as_pandas
from random_word import RandomWords

# Set working dir to manual_update, standardize yaml and src locations
root = sp.getoutput("git rev-parse --show-toplevel")
Expand Down