Skip to content

Commit 5d8ea6a

Browse files
committed
Fix edge cases in new typing
1 parent 30b3c5b commit 5d8ea6a

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

nisystemlink/clients/dataframe/_data_frame_client.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from collections.abc import Iterable
44
from io import BytesIO
5-
from typing import List
5+
from typing import List, Union
66

77
try:
88
import pyarrow as pa # type: ignore
@@ -277,11 +277,12 @@ def _append_table_data_arrow(
277277
def append_table_data(
278278
self,
279279
id: str,
280-
data:
281-
models.AppendTableDataRequest
282-
| models.DataFrame
283-
| "pa.RecordBatch" # type: ignore[name-defined]
284-
| Iterable["pa.RecordBatch"], # type: ignore[name-defined]
280+
data: Union[
281+
models.AppendTableDataRequest,
282+
models.DataFrame,
283+
"pa.RecordBatch", # type: ignore[name-defined]
284+
Iterable["pa.RecordBatch"], # type: ignore[name-defined]
285+
] | None,
285286
*,
286287
end_of_data: bool | None = None,
287288
) -> None:

nisystemlink/clients/tag/_core/_manual_reset_timer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import threading
77
import traceback
88
from types import TracebackType
9-
from typing import Any, Callable, List, Type
9+
from typing import Any, Callable, List, Optional, Type
1010

1111
import events
1212
from nisystemlink.clients.core._internal._classproperty_support import (
@@ -38,10 +38,10 @@ def __init_subclass__(cls) -> None:
3838
# Under certain circumstances, mypy complains about the event not having a type hint
3939
# unless we specify it explicitly. (But we also need to delete the attribute so that
4040
# Events.__getattr__ can do its magic.)
41-
elapsed: events._EventSlot = None # type: ignore[assignment]
41+
elapsed = None # type: events._EventSlot
4242
del elapsed
4343

44-
__null_timer_impl: "ManualResetTimer" | None = None
44+
__null_timer_impl: Optional["ManualResetTimer"] = None
4545

4646
@ClasspropertySupport.classproperty
4747
def null_timer(cls) -> "ManualResetTimer":

0 commit comments

Comments
 (0)