Skip to content

Commit

Permalink
Merge branch 'feature_1463_pandas_future_warnings' into futures_dev
Browse files Browse the repository at this point in the history
# Conflicts:
#	syscore/pandas/frequency.py
#	sysproduction/update_historical_prices.py
  • Loading branch information
bug-or-feature committed Jan 21, 2025
2 parents f17526a + 9685146 commit 8bf5829
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
7 changes: 4 additions & 3 deletions syscore/pandas/frequency.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,11 @@ def merge_data_with_different_freq(
dtype: int64
"""

if len(list_of_data) > 1:
list_as_concat_pd = pd.concat(list_of_data, axis=0)
filtered = [item for item in list_of_data if len(item) > 0]
if len(filtered) > 1:
list_as_concat_pd = pd.concat(filtered, axis=0)
else:
list_as_concat_pd = list_of_data[0]
list_as_concat_pd = filtered[0]
sorted_pd = list_as_concat_pd.sort_index()
unique_pd = uniquets(sorted_pd)

Expand Down
19 changes: 9 additions & 10 deletions sysproduction/update_historical_prices.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,20 +482,19 @@ def write_merged_prices_for_contract(
diag_prices = diagPrices(data)
price_updater = updatePrices(data)

list_of_data = []
for frequency in list_of_frequencies:
prices = diag_prices.get_prices_at_frequency_for_contract_object(
list_of_data = [
diag_prices.get_prices_at_frequency_for_contract_object(
contract_object,
frequency=frequency,
)
if len(prices) > 0:
list_of_data.append(prices)
for frequency in list_of_frequencies
]

if list_of_data:
merged_prices = merge_data_with_different_freq(list_of_data)
price_updater.overwrite_merged_prices_for_contract(
contract_object=contract_object, new_prices=merged_prices
)
merged_prices = merge_data_with_different_freq(list_of_data)

price_updater.overwrite_merged_prices_for_contract(
contract_object=contract_object, new_prices=futuresContractPrices(merged_prices)
)


if __name__ == "__main__":
Expand Down

0 comments on commit 8bf5829

Please sign in to comment.