Skip to content

Commit 974f8aa

Browse files
authored
Fix python syntax 'Self' keyword and module qualifier (#5)
1 parent 56bcb5e commit 974f8aa

File tree

10 files changed

+20
-22
lines changed

10 files changed

+20
-22
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ dependency-reduced-pom.xml
77

88
# Python building & testing
99
.tox/
10+
.DS_Store
11+
__pycache__
1012
build/
1113
dev/.conda
1214
dev/.stage.txt

java_based_implementation/api_impl.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
write_builder, table_write, commit_message, table_commit)
2323
from pyarrow import RecordBatchReader, RecordBatch
2424
from typing import List
25-
from typing_extensions import Self
2625

2726

2827
class Catalog(catalog.Catalog):
@@ -37,7 +36,7 @@ def create(catalog_context: dict) -> 'Catalog':
3736
j_catalog = gateway.jvm.CatalogFactory.createCatalog(j_catalog_context)
3837
return Catalog(j_catalog)
3938

40-
def get_table(self, identifier: tuple) -> 'Table':
39+
def get_table(self, identifier: str) -> 'Table':
4140
gateway = get_gateway()
4241
j_identifier = gateway.jvm.Identifier.fromString(identifier)
4342
j_table = self._j_catalog.getTable(j_identifier)
@@ -63,11 +62,11 @@ class ReadBuilder(read_builder.ReadBuilder):
6362
def __init__(self, j_read_builder):
6463
self._j_read_builder = j_read_builder
6564

66-
def with_projection(self, projection: List[List[int]]) -> Self:
65+
def with_projection(self, projection: List[List[int]]) -> 'ReadBuilder':
6766
self._j_read_builder.withProjection(projection)
6867
return self
6968

70-
def with_limit(self, limit: int) -> Self:
69+
def with_limit(self, limit: int) -> 'ReadBuilder':
7170
self._j_read_builder.withLimit(limit)
7271
return self
7372

@@ -121,7 +120,7 @@ class BatchWriteBuilder(write_builder.BatchWriteBuilder):
121120
def __init__(self, j_batch_write_builder):
122121
self._j_batch_write_builder = j_batch_write_builder
123122

124-
def with_overwrite(self, static_partition: dict) -> Self:
123+
def with_overwrite(self, static_partition: dict) -> 'BatchWriteBuilder':
125124
self._j_batch_write_builder.withOverwrite(static_partition)
126125
return self
127126

paimon_python_api/catalog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#################################################################################
1818

1919
from abc import ABC, abstractmethod
20-
from table import Table
20+
from paimon_python_api.table import Table
2121

2222

2323
class Catalog(ABC):

paimon_python_api/read_builder.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,20 @@
1717
#################################################################################
1818

1919
from abc import ABC, abstractmethod
20-
from table_read import TableRead
21-
from table_scan import TableScan
20+
from paimon_python_api.table_read import TableRead
21+
from paimon_python_api.table_scan import TableScan
2222
from typing import List
23-
from typing_extensions import Self
2423

2524

2625
class ReadBuilder(ABC):
2726
"""An interface for building the TableScan and TableRead."""
2827

2928
@abstractmethod
30-
def with_projection(self, projection: List[List[int]]) -> Self:
29+
def with_projection(self, projection: List[List[int]]) -> 'ReadBuilder':
3130
"""Push nested projection."""
3231

3332
@abstractmethod
34-
def with_limit(self, limit: int) -> Self:
33+
def with_limit(self, limit: int) -> 'ReadBuilder':
3534
"""Push row number."""
3635

3736
@abstractmethod

paimon_python_api/table.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
#################################################################################
1818

1919
from abc import ABC, abstractmethod
20-
from read_builder import ReadBuilder
21-
from write_builder import BatchWriteBuilder
20+
from paimon_python_api.read_builder import ReadBuilder
21+
from paimon_python_api.write_builder import BatchWriteBuilder
2222

2323

2424
class Table(ABC):

paimon_python_api/table_commit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#################################################################################
1818

1919
from abc import ABC, abstractmethod
20-
from commit_message import CommitMessage
20+
from paimon_python_api.commit_message import CommitMessage
2121
from typing import List
2222

2323

paimon_python_api/table_read.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
from abc import ABC, abstractmethod
2020
from pyarrow import RecordBatchReader
21-
from split import Split
21+
from paimon_python_api.split import Split
2222

2323

2424
class TableRead(ABC):

paimon_python_api/table_scan.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818

1919
from abc import ABC, abstractmethod
2020
from typing import List
21-
22-
from split import Split
21+
from paimon_python_api.split import Split
2322

2423

2524
class TableScan(ABC):

paimon_python_api/table_write.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#################################################################################
1818

1919
from abc import ABC, abstractmethod
20-
from commit_message import CommitMessage
20+
from paimon_python_api.commit_message import CommitMessage
2121
from pyarrow import RecordBatch
2222
from typing import List
2323

paimon_python_api/write_builder.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,15 @@
1717
#################################################################################
1818

1919
from abc import ABC, abstractmethod
20-
from table_commit import BatchTableCommit
21-
from table_write import BatchTableWrite
22-
from typing_extensions import Self
20+
from paimon_python_api.table_commit import BatchTableCommit
21+
from paimon_python_api.table_write import BatchTableWrite
2322

2423

2524
class BatchWriteBuilder(ABC):
2625
"""An interface for building the TableScan and TableRead."""
2726

2827
@abstractmethod
29-
def with_overwrite(self, static_partition: dict) -> Self:
28+
def with_overwrite(self, static_partition: dict) -> 'BatchWriteBuilder':
3029
"""
3130
Overwrite writing, same as the 'INSERT OVERWRITE T PARTITION (...)' semantics of SQL.
3231
If you pass an empty dict, it means OVERWRITE whole table.

0 commit comments

Comments
 (0)