Skip to content

Commit 0b324ac

Browse files
author
jenkins
committed
git subrepo pull (merge) ore
subrepo: subdir: "ore" merged: "d427c57b8f" upstream: origin: "git@gitlab.acadiasoft.net:qs/ore.git" branch: "master" commit: "d40562543e" git-subrepo: version: "0.4.6" origin: "https://github.com/ingydotnet/git-subrepo" commit: "110b9eb"
2 parents 06f1cac + d405625 commit 0b324ac

2 files changed

Lines changed: 30 additions & 1 deletion

File tree

Tools/PythonTools/compare_files.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,17 @@ def compare_files_df(name, file_1, file_2, config):
397397
if 'optional_cols' in config:
398398
optional_cols = copy.deepcopy(config['optional_cols'])
399399
logger.debug('Optional columns found: %s', str (optional_cols))
400+
401+
# Check that each optional col either exists in both DataFrames, or is missing in both. Otherwise, we fail the test.
402+
missing_ocols = []
403+
for col in optional_cols:
404+
if (col in df_1.columns and col not in df_2.columns) or (col not in df_1.columns and col in df_2.columns):
405+
missing_ocols.append(col)
406+
if missing_ocols:
407+
logger.warning('The columns, %s, are in one Dataframe but not the other.', str(missing_ocols))
408+
return False
409+
410+
# For each optional col, check whether it is found in each DataFrame. If so, add it.
400411
for col in optional_cols:
401412
if col in df_1.columns and col in df_2.columns :
402413
logger.debug('Adding optional column %s to list of columns for comparison', col)

Tools/PythonTools/comparison_config.json

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,24 @@
227227
"TradeType"
228228
],
229229
"optional_cols": [
230-
"BaseCurrency"
230+
"BaseCurrency",
231+
"end_date",
232+
"trade_date",
233+
"notional",
234+
"trade_currency",
235+
"notional2",
236+
"trade_currency2",
237+
"underlying",
238+
"mtm_curr",
239+
"mtm_value",
240+
"settlement_type",
241+
"strike",
242+
"call_put",
243+
"long_short",
244+
"asset_class",
245+
"base_product",
246+
"sub_product",
247+
"xccy_resettable"
231248
],
232249
"optional_keys": [
233250
"collect_regulations",
@@ -763,6 +780,7 @@
763780
"ProductClass",
764781
"RiskClass",
765782
"MarginType",
783+
"Bucket",
766784
"SimmSide"
767785
],
768786
"rename_cols": {

0 commit comments

Comments
 (0)