kunwp1 commented on code in PR #9623:
URL: https://github.com/apache/texera/pull/9623#discussion_r4670657828
##########
amber/src/test/python/core/models/test_table.py:
##########
@@ -65,33 +65,17 @@ def target_table(self, target_raw_tuples):
return Table(target_raw_tuples)
@pytest.fixture
- def target_data_frame(self, a_timestamp):
+ def target_data_frame(self, target_raw_tuples):
return pandas.DataFrame(
- {
- "field1": [1, 2],
- "field2": ["hello", "world"],
- "field3": [2.3, 0.0],
- "field4": [True, False],
- "field5": [
- a_timestamp,
- datetime.datetime.fromtimestamp(1000000000),
- ],
- "field6": [b"some binary", pickle.dumps([1, 2, 3])],
- "7_special-name": [None, "a strange value"],
- "none": [None, None],
- },
- columns=[
- "field1",
- "field2",
- "field3",
- "field4",
- "field5",
- "field6",
- "7_special-name",
- "none",
- ],
+ target_raw_tuples, columns=list(target_raw_tuples[0].keys())
)
Review Comment:
This now builds the expected frame from `target_raw_tuples`, the same data
`target_table` comes from, so `test_table_from_data_frame` and
`test_use_table_as_data_frame` lose their independent values and column order.
I'd keep the literal frame here.
##########
amber/src/test/python/core/architecture/rpc/test_async_rpc_server.py:
##########
@@ -108,6 +108,45 @@ def _return_invocation_of(element: DCMElement) ->
ReturnInvocation:
return get_one_of(element.payload, sealed=False)
+def _reply_handler(*messages) -> grpclib.const.Handler:
+ async def handler_func(stream):
+ for message in messages:
+ await stream.send_message(message)
+
+ return _make_handler(handler_func)
+
+
+def _error_handler(exc: Exception) -> grpclib.const.Handler:
+ async def handler_func(stream):
+ raise exc
+
+ return _make_handler(handler_func)
+
+
+def _dispatch(
+ handlers: dict,
+ method_name: str,
+ command_id: int,
+ *,
+ from_name: str = "A",
+ to_name: str = "B",
+ context: AsyncRpcContext | None = None,
+ is_control: bool = True,
+) -> AsyncRPCServer:
+ server = _make_server(handlers)
+ channel = ChannelIdentity(
+ from_worker_id=ActorVirtualIdentity(name=from_name),
+ to_worker_id=ActorVirtualIdentity(name=to_name),
+ is_control=is_control,
+ )
Review Comment:
`_make_channel` above builds the same `ChannelIdentity`. An `is_control:
bool = True` parameter there lets `_dispatch` call it.
##########
amber/src/test/python/pytexera/storage/test_large_binary_output_stream.py:
##########
@@ -233,7 +186,6 @@ def test_write_after_upload_error_raises_error(self,
large_binary):
with pytest.raises(IOError):
stream.close()
- @pytest.mark.timeout(5)
def test_write_unblocks_when_upload_fails_with_full_queue(self,
large_binary):
Review Comment:
This test lost its `@pytest.mark.timeout(5)`. `pyproject.toml` sets no
global timeout, and `close()` waits on `_upload_thread.join()` and
`_upload_complete.wait()` with no limit, so a regression there would now hang
the pyamber job until GitHub's 6-hour default instead of failing in 5 s. The
test also still patches both S3 hooks by hand; `_mock_s3_upload() as mock_s3`
covers that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]