DP to CA bug
Description
By running PDLC on CODECO with the ICOM's environmet the following issue happens when an application is deployed:
Directory '/data/CA/' already exists.
Directory '/data/GNN/' already exists.
Directory '/data/RL/' already exists.Directory '/data/min_max/' already exists.
[RL - INFO]- data exist the collection has begun
[GNNs - INFO]- data exist the collection has begun
Exception in thread Thread-4 (use_CA):
Traceback (most recent call last):
File "/usr/local/lib/python3.12/threading.py", line 1075, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.12/threading.py", line 1012, in run
self._target(*self._args, **self._kwargs)
File "/app/gatherer.py", line 65, in use_CA
[INFO] - 2024-10-17 10:38:07.495049: Files /data/RL/test_integracio.csv and /data/RL/test_nodes.csv updated successfully
CA_operations(CA_list)
File "/app/pp_module/ca.py", line 108, in CA_operations
ca_df[feature] = ca_df[feature].str.extract(r'(\d+)').astype(float)
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pandas/core/generic.py", line 6299, in __getattr__
[INFO] - 2024-10-17 10:38:07.503593: File /data/GNN/data_GNN.csv updated successfully
return object.__getattribute__(self, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pandas/core/accessor.py", line 224, in __get__
accessor_obj = self._accessor(obj)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pandas/core/strings/accessor.py", line 191, in __init__
self._inferred_dtype = self._validate(data)
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pandas/core/strings/accessor.py", line 245, in _validate
raise AttributeError("Can only use .str accessor with string values!")
AttributeError: Can only use .str accessor with string values!. Did you mean: 'std'?
Directory '/data/GNN/' already exists.
Directory '/data/min_max/' already exists.
The above makes PDLC-DP unable to provide the needed CSV file of CA.
Possible Solution
Because of the Exeption, anexpected String values are passing to PDLC-PP by PDLC-Gatherer causing PP to fail. Either the Gatherer should handle this by making the values numeric or PP should handle this by being able to handle string values.
Edited by Panagiotis Karamolegkos