Skip to content

Inventory_automation#14

Open
aa221 wants to merge 5 commits intomainfrom
automation_inventory
Open

Inventory_automation#14
aa221 wants to merge 5 commits intomainfrom
automation_inventory

Conversation

@aa221
Copy link
Copy Markdown
Collaborator

@aa221 aa221 commented Oct 23, 2021

Inventory automation script.

Copy link
Copy Markdown
Owner

@stackman27 stackman27 left a comment

Choose a reason for hiding this comment

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

Concept ACK b78240b

You're missing some values, and some value types are faulty. For instance, when I ran the code to generate new products this is the key i got

{
    "upc": 499127930077,
    "department": "Fresh Produce",
    "product_name": "Org. Mango",
    "crv_by_05_cents": 1,
    "Price": 2.99,
    "size": null,
    "upce": "0",
    "has_crv": false,
    "sugar_column": 0.0,
    "is_taxable": false,
    "Images": "",
    "sugar_tax": 0,
    "contains_promotion": false
  }

Whereas it should be

  {
    "has_crv": false,
    "promotion_data": "",
    "has_sugar_tax": false,
    "contains_promotion": false,
    "size": 0,
    "crv_by_05_cents": 1,
    "sugar_tax": 0,
    "has_sales_tax": false,
    "sell_price": 2.69,
    "department": "Food",
    "product_name": "GI KB Pork Jerky",
    "upc": "10082890093",
    "upce": 1000903,
    "img": ""
  }

Ignore the exact product values and focus on the value type like bool, int, float

df = df.rename(columns={"Department": "department",
"Name": "product_name", "Fee Multiplier": "crv_by_05_cents"})
df = df[["upc", "department", "product_name",
"crv_by_05_cents", "Price", "size"]]
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Please change Price to sellPrice

sugar_column.append(False)
else:
sugar_column.append(True)
table4["sugar_column"] = sugar_column
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

change sugar_column to sugar_tax and also change it from float to int

def get_taxable(df):
table44 = df[(df["department"] == "Energy") | (df["department"] == "Pets") | (df["department"] == "Soda") | (
df["department"] == "Household Essentials") | (df["department"] == "Health & Wellness")]
table44["is_taxable"] = True
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

change is_taxable to has_sales_tax

final_changed_products = exclude_promos[exclude_promos["upc"].isin(
changed_prices["upc"])]
final_changed_products["contains_promotion"] = False
final_changed_products["Images"] = merged_promotions["img"]
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

change Images to img

@aa221 aa221 force-pushed the automation_inventory branch from 81d1f6c to 86e5f1c Compare October 26, 2021 07:59
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