-
Notifications
You must be signed in to change notification settings - Fork 57
Description
I'm trying to run an ASYNC function to read some CSV data using PANDAS DataFrames. When I run my code from Developer Tools (Actions) within HA the (calling) function indicates a successful run (green tick) but the code returns error "The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().".
In my code I have "if matching_days.empty:", but this code is never exercised, even if I change the code to "if NOT matching_days.empty:". So I conclude the issue is somewhere within the pyscript integration.
The Logger information is:
Detected blocking call to import_module with args ('zstandard',) inside the event loop by custom integration 'pyscript' at custom_components/pyscript/eval.py, line 1983: return func(*args, **kwargs) (offender: /usr/local/lib/python3.13/site-packages/pandas/compat/_optional.py, line 135: module = importlib.import_module(name)), please create a bug report at https://github.com/custom-components/pyscript/issues For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#import_module Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/main.py", line 223, in sys.exit(main()) File "/usr/src/homeassistant/homeassistant/main.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 154, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.13/asyncio/base_events.py", line 706, in run_until_complete self.run_forever() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 677, in run_forever self._run_once() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 2034, in _run_once handle._run() File "/usr/local/lib/python3.13/asyncio/events.py", line 89, in _run self._context.run(self._callback, *self._args) File "/config/custom_components/pyscript/function.py", line 448, in run_coro result = await coro File "/config/custom_components/pyscript/eval.py", line 509, in do_service_call retval = await func.call(ast_ctx, **data) File "/config/custom_components/pyscript/eval.py", line 801, in call val = await self.try_aeval(ast_ctx, arg1) File "/config/custom_components/pyscript/eval.py", line 701, in try_aeval return await ast_ctx.aeval(arg) File "/config/custom_components/pyscript/eval.py", line 941, in aeval val = await getattr(self, name, self.ast_not_implemented)(arg) File "/config/custom_components/pyscript/eval.py", line 1469, in ast_assign rhs = await self.aeval(arg.value) File "/config/custom_components/pyscript/eval.py", line 941, in aeval val = await getattr(self, name, self.ast_not_implemented)(arg) File "/config/custom_components/pyscript/eval.py", line 2024, in ast_await coro = await self.aeval(arg.value) File "/config/custom_components/pyscript/eval.py", line 941, in aeval val = await getattr(self, name, self.ast_not_implemented)(arg) File "/config/custom_components/pyscript/eval.py", line 1938, in ast_call return await self.call_func(func, func_name, *args, **kwargs) File "/config/custom_components/pyscript/eval.py", line 1953, in call_func return await func.call(self, *args, **kwargs) File "/config/custom_components/pyscript/eval.py", line 853, in call return await self.func.call(ast_ctx, *args, **kwargs) File "/config/custom_components/pyscript/eval.py", line 801, in call val = await self.try_aeval(ast_ctx, arg1) File "/config/custom_components/pyscript/eval.py", line 701, in try_aeval return await ast_ctx.aeval(arg) File "/config/custom_components/pyscript/eval.py", line 941, in aeval val = await getattr(self, name, self.ast_not_implemented)(arg) File "/config/custom_components/pyscript/eval.py", line 1225, in ast_try val = await self.aeval(arg1) File "/config/custom_components/pyscript/eval.py", line 941, in aeval val = await getattr(self, name, self.ast_not_implemented)(arg) File "/config/custom_components/pyscript/eval.py", line 1469, in ast_assign rhs = await self.aeval(arg.value) File "/config/custom_components/pyscript/eval.py", line 941, in aeval val = await getattr(self, name, self.ast_not_implemented)(arg) File "/config/custom_components/pyscript/eval.py", line 2024, in ast_await coro = await self.aeval(arg.value) File "/config/custom_components/pyscript/eval.py", line 941, in aeval val = await getattr(self, name, self.ast_not_implemented)(arg) File "/config/custom_components/pyscript/eval.py", line 1938, in ast_call return await self.call_func(func, func_name, *args, **kwargs) File "/config/custom_components/pyscript/eval.py", line 1953, in call_func return await func.call(self, *args, **kwargs) File "/config/custom_components/pyscript/eval.py", line 853, in call return await self.func.call(ast_ctx, *args, **kwargs) File "/config/custom_components/pyscript/eval.py", line 801, in call val = await self.try_aeval(ast_ctx, arg1) File "/config/custom_components/pyscript/eval.py", line 701, in try_aeval return await ast_ctx.aeval(arg) File "/config/custom_components/pyscript/eval.py", line 941, in aeval val = await getattr(self, name, self.ast_not_implemented)(arg) File "/config/custom_components/pyscript/eval.py", line 1469, in ast_assign rhs = await self.aeval(arg.value) File "/config/custom_components/pyscript/eval.py", line 941, in aeval val = await getattr(self, name, self.ast_not_implemented)(arg) File "/config/custom_components/pyscript/eval.py", line 1938, in ast_call return await self.call_func(func, func_name, *args, **kwargs) File "/config/custom_components/pyscript/eval.py", line 1983, in call_func return func(*args, **kwargs)