vizflow 0.5.4__py3-none-any.whl → 0.5.6__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.
vizflow/__init__.py CHANGED
@@ -5,7 +5,7 @@ Usage:
5
5
  import vizflow as vf
6
6
  """
7
7
 
8
- __version__ = "0.5.4"
8
+ __version__ = "0.5.5"
9
9
 
10
10
  from .config import Config, get_config, set_config
11
11
  from .io import (
vizflow/io.py CHANGED
@@ -213,11 +213,10 @@ def scan_trades(config: Config | None = None) -> pl.LazyFrame:
213
213
  df = _apply_schema_evolution(df, schema)
214
214
  date = _extract_date_from_path(f, config.trade_pattern)
215
215
  if date:
216
- df = df.with_columns(pl.lit(date).alias("data_date"))
216
+ df = df.with_columns(pl.lit(date).str.to_date("%Y%m%d").alias("data_date"))
217
217
  dfs.append(df)
218
218
 
219
- # Use diagonal concat to handle files with different column sets
220
- return pl.concat(dfs, how="diagonal")
219
+ return pl.concat(dfs)
221
220
 
222
221
 
223
222
  def scan_alpha(date: str, config: Config | None = None) -> pl.LazyFrame:
@@ -274,16 +273,19 @@ def scan_alphas(config: Config | None = None) -> pl.LazyFrame:
274
273
  schema = _resolve_schema(config.alpha_schema)
275
274
 
276
275
  # Apply schema evolution per-file BEFORE concat to ensure matching schemas
277
- # Note: Alpha files already have data_date column, no need to add it
276
+ # Note: Alpha files already have data_date column, convert to Date type for consistency
278
277
  dfs = []
279
278
  for f in files:
280
279
  df = _scan_file(f, schema=schema)
281
280
  if schema:
282
281
  df = _apply_schema_evolution(df, schema)
282
+ # Convert data_date to Date type (may be Int64 from feather or String from CSV)
283
+ df = df.with_columns(
284
+ pl.col("data_date").cast(pl.String).str.to_date("%Y%m%d")
285
+ )
283
286
  dfs.append(df)
284
287
 
285
- # Use diagonal concat to handle files with different column sets
286
- return pl.concat(dfs, how="diagonal")
288
+ return pl.concat(dfs)
287
289
 
288
290
 
289
291
  def scan_univ(date: str, config: Config | None = None) -> pl.LazyFrame:
@@ -349,11 +351,10 @@ def scan_univs(config: Config | None = None) -> pl.LazyFrame:
349
351
  df = _apply_schema_evolution(df, schema)
350
352
  date = _extract_date_from_path(f, config.univ_pattern)
351
353
  if date:
352
- df = df.with_columns(pl.lit(date).alias("data_date"))
354
+ df = df.with_columns(pl.lit(date).str.to_date("%Y%m%d").alias("data_date"))
353
355
  dfs.append(df)
354
356
 
355
- # Use diagonal concat to handle files with different column sets
356
- return pl.concat(dfs, how="diagonal")
357
+ return pl.concat(dfs)
357
358
 
358
359
 
359
360
  def load_calendar(config: Config | None = None) -> pl.DataFrame:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vizflow
3
- Version: 0.5.4
3
+ Version: 0.5.6
4
4
  Requires-Python: >=3.9
5
5
  Requires-Dist: polars>=0.20.0
6
6
  Provides-Extra: dev
@@ -1,10 +1,10 @@
1
- vizflow/__init__.py,sha256=bS3aie9FcQJAp8LP3kjtSOkfy1ArDElPGSmdT7ga1_o,589
1
+ vizflow/__init__.py,sha256=_jP6bp5U2iBFkPGTSLNwvOQay9XU_opNdrylF22iR9s,589
2
2
  vizflow/config.py,sha256=nPZPXlqQbaY8u_FAdtPShvb0mdx3e2TRaQ2CILzliAU,7192
3
- vizflow/io.py,sha256=J83xICjViB5377mU-9RHbfY0hh3t01zjmSEUm2jgfp8,11606
3
+ vizflow/io.py,sha256=5gucUD68zBhfnVOmFRbDyxqVM5ikzPWRTeOY20gXQOM,11612
4
4
  vizflow/market.py,sha256=MtNz_nnZxC66Aq-i2PXEwaFCTknijFWYZUUv6798k2s,2493
5
5
  vizflow/ops.py,sha256=oR44HYKrfaXLh0SmbfXefl714UESSIC5lTNJBrR1kto,10858
6
6
  vizflow/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  vizflow/schema_evolution.py,sha256=puwuuJ8LAzelHq1JTwQD968J7GYLvgAsCaHJnDHzu4U,14025
8
- vizflow-0.5.4.dist-info/METADATA,sha256=UMLk7qNhT8XQjduNmYP6GGiK8_jy8LRnJL0fOTMqdT0,388
9
- vizflow-0.5.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
- vizflow-0.5.4.dist-info/RECORD,,
8
+ vizflow-0.5.6.dist-info/METADATA,sha256=oadPQYbrOT8G2aPZ-QZ1_VZ0uqRbde62ddsZnnmDKHE,388
9
+ vizflow-0.5.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
+ vizflow-0.5.6.dist-info/RECORD,,