Skip to content

Commit

Permalink
fix: type conversions in index columns
Browse files Browse the repository at this point in the history
  • Loading branch information
paulrunco committed Nov 23, 2022
1 parent 8d51397 commit 6570fb7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project attempts to adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.1] - 2022-11-23
### Fixed
- A type conversion in the index columns which was causing the lookup (join) of promise dates to fail

## [1.1.0] - 2022-06-10
### Added
- Feature to detect and fix Excel-formatted dates in the input data
Expand Down
12 changes: 10 additions & 2 deletions functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,21 @@ def update_report(path_to_date_verification, path_to_estimated_completion, trans
sheet_name='Requested Updates'
))

# Create an index column using order-release
promise_date['Order-Line'] = promise_date['PO #'].astype(str) + '-' + promise_date['Line #'].astype(str)
promise_date = promise_date.set_index(['Order-Line'])

## Make a dataframe of the input data
estimated_date = pd.DataFrame(pd.read_excel(
path_to_estimated_completion,
header=0,
sheet_name=0,
usecols='A:H'
)).set_index(['PO', 'Line'])
))

# Create an index column using order-release
estimated_date['Order-Line'] = estimated_date['PO'].astype(str) + '-' + estimated_date['Line'].astype(str)
estimated_date = estimated_date.set_index(['Order-Line'])

## Find and fix Excel-formatted dates

Expand All @@ -38,7 +46,7 @@ def update_report(path_to_date_verification, path_to_estimated_completion, trans
## Look up estimated completion dates from scheduling sheet
promise_date = promise_date.join(
estimated_date['Estimated Ship Date'],
on=['PO #', 'Line #'])
on=['Order-Line'])

# Update promise dates
if include_weekends:
Expand Down

0 comments on commit 6570fb7

Please sign in to comment.