Skip to content

Commit 9cd8048

Browse files
zxqfd555Manul from Pathway
authored andcommitted
fix autogenerated persistent id duplication error (#9482)
GitOrigin-RevId: fc362b90a084d88ac7115e2e9243bb630ec31d57
1 parent a7afe49 commit 9cd8048

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
1717
- Endpoints created by `pw.io.http.rest_connector` now accept requests both with and without a trailing slash. For example, `/endpoint/` and `/endpoint` are now treated equivalently.
1818
- Schemas that inherit from other schemas now automatically preserve all properties from their parent schemas.
1919
- Fixed an issue where the persistence configuration failed when provided with a relative filesystem path.
20+
- Fixed unique name autogeneration for the Python connectors.
2021

2122
## [0.26.4] - 2025-10-16
2223

python/pathway/tests/test_io.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,6 +1205,29 @@ def test_duplicated_name(tmp_path: pathlib.Path):
12051205
)
12061206

12071207

1208+
def test_duplicated_name_for_python_connector(tmp_path: pathlib.Path):
1209+
class MySchema(pw.Schema):
1210+
a: int
1211+
b: str
1212+
1213+
class MySubject(pw.io.python.ConnectorSubject):
1214+
def run(self) -> None:
1215+
for i in range(4):
1216+
self.next(a=i, b=f"x{i}")
1217+
1218+
@property
1219+
def _deletions_enabled(self) -> bool:
1220+
return False
1221+
1222+
t1 = pw.io.python.read(MySubject(), schema=MySchema)
1223+
t2 = pw.io.python.read(MySubject(), schema=MySchema)
1224+
pw.io.null.write(t1)
1225+
pw.io.null.write(t2)
1226+
persistence_backend = pw.persistence.Backend.filesystem(tmp_path / "PStorage")
1227+
persistence_config = pw.persistence.Config(persistence_backend)
1228+
run_all(persistence_config=persistence_config)
1229+
1230+
12081231
def test_duplicated_name_between_input_and_output(tmp_path: pathlib.Path):
12091232
pstorage_path = tmp_path / "PStorage"
12101233
input_path = tmp_path / "input_first.txt"

src/engine/dataflow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3895,7 +3895,7 @@ impl<S: MaybeTotalScope<MaybeTotalTimestamp = Timestamp>> DataflowGraphInner<S>
38953895
unique_name,
38963896
RequiredPersistenceMode::InputOrOperatorPersistence,
38973897
|_| {
3898-
let generated_external_id = reader.name(None);
3898+
let generated_external_id = format!("{}-{}", reader.name(None), self.pollers.len());
38993899
info!(
39003900
"Unique name autogenerated for a {:?} reader because persistence is enabled: {generated_external_id}",
39013901
reader.storage_type()

0 commit comments

Comments
 (0)