Open
Conversation
stackman27
reviewed
Oct 26, 2021
Owner
There was a problem hiding this comment.
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"]] |
Owner
There was a problem hiding this comment.
Please change Price to sellPrice
| sugar_column.append(False) | ||
| else: | ||
| sugar_column.append(True) | ||
| table4["sugar_column"] = sugar_column |
Owner
There was a problem hiding this comment.
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 |
Owner
There was a problem hiding this comment.
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"] |
81d1f6c to
86e5f1c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Inventory automation script.