Skip to content

Commit e51cb36

Browse files
author
César Román
authored
refactor(helper): move SProcResult from helper.types to db module (#141)
1 parent 4747eb4 commit e51cb36

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

Diff for: src/incendium/db.py

+13-3
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,23 @@
1515
]
1616

1717
from types import TracebackType
18-
from typing import Any, List, Optional, Tuple, Type, Union
18+
from typing import Any, List, Optional, Tuple, Type, TypedDict, Union
1919

2020
import system.db
2121
from com.inductiveautomation.ignition.common import BasicDataset
2222
from java.lang import Thread
2323

24-
from incendium.helper.types import AnyStr, DictIntStringAny, SProcResult
24+
from incendium.helper.types import AnyStr, DictIntStringAny
25+
26+
_SProcResult = TypedDict(
27+
"_SProcResult",
28+
{
29+
"output_params": DictIntStringAny,
30+
"result_set": BasicDataset,
31+
"return_value": Optional[int],
32+
"update_count": int,
33+
},
34+
)
2535

2636

2737
class DisposableConnection(object):
@@ -193,7 +203,7 @@ def _execute_sp(
193203
get_update_count=False, # type: bool
194204
return_type_code=system.db.INTEGER, # type: int
195205
):
196-
# type: (...) -> SProcResult
206+
# type: (...) -> _SProcResult
197207
"""Execute a stored procedure against the connection.
198208
199209
Args:

Diff for: src/incendium/helper/types.py

+1-11
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
11
"""Types module."""
22

3-
from typing import Any, Dict, Optional, TypedDict, Union
3+
from typing import Any, Dict, Optional, Union
44

5-
from com.inductiveautomation.ignition.common import BasicDataset
65
from java.lang import Exception as JavaException
76

87
AnyStr = Union[str, unicode]
98
DictIntStringAny = Dict[Union[int, str, unicode], Any]
109
DictStringAny = Dict[Union[str, unicode], Any]
1110
InnerException = Optional[Union[Exception, JavaException]]
1211
Number = Union[float, int, long]
13-
SProcResult = TypedDict(
14-
"SProcResult",
15-
{
16-
"output_params": DictIntStringAny,
17-
"result_set": BasicDataset,
18-
"return_value": Optional[int],
19-
"update_count": int,
20-
},
21-
)

0 commit comments

Comments
 (0)