chore: fix pyright errors to make pipeline green

This commit is contained in:
Konstantin Fickel 2025-10-12 08:30:10 +02:00
parent 73268a8039
commit eaf7fe9b2a
Signed by: kfickel
GPG key ID: A793722F9933C1A5
8 changed files with 15 additions and 15 deletions

View file

@ -1,4 +1,4 @@
from typing import Optional
from streamer.parse.shard import Shard, StreamFile
from .repostory_configuration import RepositoryConfiguration
@ -10,7 +10,7 @@ def localize_shard(
shard: Shard, config: RepositoryConfiguration, propagated: dict[str, str]
) -> LocalizedShard:
position = {**propagated}
private_position = {}
private_position: dict[str, str] = {}
for marker in shard.markers:
normalized_marker = marker.lower()
@ -25,7 +25,7 @@ def localize_shard(
children = [localize_shard(child, config, position) for child in shard.children]
(position.update(private_position),)
position.update(private_position)
return LocalizedShard(
**shard.model_dump(exclude={"children"}), location=position, children=children
@ -34,9 +34,12 @@ def localize_shard(
def localize_stream_file(
stream_file: StreamFile, config: RepositoryConfiguration
) -> Optional[LocalizedShard]:
) -> LocalizedShard | None:
shard_date = extract_date_from_file_name(stream_file.filename)
if not shard_date or not stream_file.shard:
raise ValueError("Could not extract date")
return localize_shard(stream_file.shard, config, {"moment": shard_date.isoformat()})