wbfdm 1.51.5__py2.py3-none-any.whl → 1.51.7__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of wbfdm might be problematic. Click here for more details.

@@ -175,7 +175,9 @@ class InstrumentImportHandler(ImportExportHandler):
175
175
  if isinstance(data, int):
176
176
  data = dict(id=data)
177
177
  if data.get("currency", None):
178
- data["currency"] = self.currency_handler.process_object(data["currency"], read_only=True)[0]
178
+ data["currency"] = self.currency_handler.process_object(
179
+ data["currency"], read_only=True, raise_exception=False
180
+ )[0]
179
181
  if instrument_type := data.get("instrument_type", None):
180
182
  if isinstance(instrument_type, str):
181
183
  data["instrument_type"] = InstrumentType.objects.get_or_create(
@@ -1,3 +1,4 @@
1
+ import logging
1
2
  from contextlib import suppress
2
3
  from datetime import date
3
4
  from decimal import Decimal
@@ -21,6 +22,8 @@ from wbcore.contrib.currency.models import CurrencyFXRates
21
22
 
22
23
  from wbfdm.enums import MarketData
23
24
 
25
+ logger = logging.getLogger("pms")
26
+
24
27
 
25
28
  class InstrumentQuerySet(QuerySet):
26
29
  def filter_active_at_date(self, val_date: date):
@@ -150,6 +153,12 @@ class InstrumentQuerySet(QuerySet):
150
153
 
151
154
  for instrument_id, dff in df.groupby("instrument_id", group_keys=False, as_index=False):
152
155
  dff = dff.drop(columns=["instrument_id"]).set_index("date").sort_index()
156
+ if dff.index.duplicated().any():
157
+ dff = dff.groupby(level=0).first()
158
+ logger.warning(
159
+ f"We detected a duplicated index for instrument id {instrument_id}. Please correct the dl parameter which likely introduced this issue."
160
+ )
161
+
153
162
  dff = dff.reindex(pd.date_range(dff.index.min(), dff.index.max(), freq="B"))
154
163
  dff[["close", "market_capitalization"]] = dff[["close", "market_capitalization"]].astype(float).ffill()
155
164
  dff.volume = dff.volume.astype(float).fillna(0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wbfdm
3
- Version: 1.51.5
3
+ Version: 1.51.7
4
4
  Summary: The workbench module ensures rapid access to diverse financial data (market, fundamental, forecasts, ESG), with features for storing instruments, classifying them, and conducting financial analysis.
5
5
  Author-email: Christopher Wittlinger <c.wittlinger@stainly.com>
6
6
  Requires-Dist: roman==4.*
@@ -162,7 +162,7 @@ wbfdm/import_export/backends/refinitiv/mixin.py,sha256=DlNHOWOO71PgY0umaZd0Nbbjs
162
162
  wbfdm/import_export/backends/refinitiv/utils/__init__.py,sha256=Rz38xsLAHEyEwIuJksejYExEznlPJb9tRzwJ7JG9L1s,35
163
163
  wbfdm/import_export/backends/refinitiv/utils/controller.py,sha256=yG8V4C2TGhJdKwTeuMfaG1lzJ3MjNaV632KTe0nuym8,7348
164
164
  wbfdm/import_export/handlers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
165
- wbfdm/import_export/handlers/instrument.py,sha256=ccY5zcsL8SwR9-PzhFjfHpnvA4DzZ-8FoErEzmCMG3g,11463
165
+ wbfdm/import_export/handlers/instrument.py,sha256=4ElF54ke7eBlzZIXqGCEZQR563SkBbooxrEUsLOukdA,11516
166
166
  wbfdm/import_export/handlers/instrument_list.py,sha256=mZRfpJFi6BhhrjH2qaFEPqqCK2ybg-DQm43Uck7G9_w,4864
167
167
  wbfdm/import_export/handlers/instrument_price.py,sha256=RbNTo78zZuttzlVFKxJrHcW7DRfcsta7QDEI8OiiDrA,3498
168
168
  wbfdm/import_export/handlers/option.py,sha256=DtqqdOMEA-u3jWVjmxRPKJ8miENj_t1k2DzAZEoOtXU,2384
@@ -239,7 +239,7 @@ wbfdm/models/instruments/instrument_requests.py,sha256=XbpofRS8WHadHlTFjvXJyd0o7
239
239
  wbfdm/models/instruments/instruments.py,sha256=Heyk5cBJJ7ZkoDuZnTuWxB7LMmp_BZb2feW_exs1oIA,40276
240
240
  wbfdm/models/instruments/options.py,sha256=hFprq7B5t4ctz8nVqzFsBEzftq_KDUSsSXl1zJyh7tE,7094
241
241
  wbfdm/models/instruments/private_equities.py,sha256=uzwZi8IkmCKAHVTxnuFya9tehx7kh57sTlTEi1ieDaM,2198
242
- wbfdm/models/instruments/querysets.py,sha256=c9fbHVvIRyaFU7jm_CM90lfIVzB8beOD8YII9-FqdT4,7191
242
+ wbfdm/models/instruments/querysets.py,sha256=HasdW7fzDnQk1L-TN2RhaasPGRZ9ohOqcT_n5VwdwHE,7565
243
243
  wbfdm/models/instruments/utils.py,sha256=88jnWINSSC0OwH-mCEOPLZXuhBCtEsxBpSaZ38GteaE,1365
244
244
  wbfdm/models/instruments/llm/__init__.py,sha256=dSmxRmEWb0A4O_lUoWuRKt2mBtUuLCTPVVJqGyi_n40,52
245
245
  wbfdm/models/instruments/llm/create_instrument_news_relationships.py,sha256=f9MT-8cWYlexUfCkaOJa9erI9RaUNI-nqCEyf2tDkbA,3809
@@ -357,6 +357,6 @@ wbfdm/viewsets/statements/__init__.py,sha256=odxtFYUDICPmz8WCE3nx93EvKZLSPBEI4d7
357
357
  wbfdm/viewsets/statements/statements.py,sha256=gA6RCI8-B__JwjEb6OZxpn8Y-9aF-YQ3HIQ7e1vfJMw,4304
358
358
  wbfdm/viewsets/technical_analysis/__init__.py,sha256=qtCIBg0uSiZeJq_1tEQFilnorMBkMe6uCMfqar6-cLE,77
359
359
  wbfdm/viewsets/technical_analysis/monthly_performances.py,sha256=O1j8CGfOranL74LqVvcf7jERaDIboEJZiBf_AbbVDQ8,3974
360
- wbfdm-1.51.5.dist-info/METADATA,sha256=TaKLWPf99XxSz7Uu_EMluMgcQOHChYLVun8pTrb9uzc,737
361
- wbfdm-1.51.5.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
362
- wbfdm-1.51.5.dist-info/RECORD,,
360
+ wbfdm-1.51.7.dist-info/METADATA,sha256=vUjkHojGS1G0p5Xr2rnE8qb4RGvUlutF4hDBv6u6DJQ,737
361
+ wbfdm-1.51.7.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
362
+ wbfdm-1.51.7.dist-info/RECORD,,
File without changes