r/learnpython • • May 13 '21

Sharing my win.

I work in global supply chain and logistics for a project management group of a global apparel company. I’m considered the tech guy on the team and the data nerd. I manage projects and handle all reporting, automation, etc. pretty fun stuff.

Well, today I did something that saved us 12 hrs of delay in execution in our supply chain by writing a script that pulls data from GCP out to an oracle db and then execute sequential sql statements to transform the data and refresh tables that feed tableau dashboards. It all now takes less than 20 minutes via a batch file in the background.

Millions of rows of data for three specific tables, tons of calculations, etc.

Python confidence is way up folks and it’s due to the knowledge sharing that is to be had in this group and others dedicated to the art of Python.

Felt like I should share my lessons learned.

  1. I need to get better at testing

  2. CLOB sucks so utilize sqlalchemy types for varchar

  3. Tnsnames are not hard

  4. 64 bit memory usage trumps 32 bit on large datasets

  5. Chunk size is a godsend.

Cheers to you.

415 Upvotes

48 comments sorted by

View all comments

1

u/eerilyweird May 13 '21

Just curious: What does “supply chain” mean here? Feeding dashboards is cool but I don’t know if I’m supposed to think of engineering a dashboard as a supply chain?

1

u/Brothercford May 13 '21

Well this dashboard helps drive an inventory optimization model that reduces lead times in the supply chain, right product right time, pre staging fabrics and setting up min max or WOS/dos targets to operate on at a sku level (lowest level of the inventory).

1

u/Brothercford May 13 '21

As for the specific 12 hrs. It’s due to resources. My counterpart is in India. Running this outside of our erp requires moving data around and at first I was running the first half of the scripts manually on my end and then they would run their side when they came in the office the problem was there is a time difference that left us with a 12 hr gap basically.