Closed vfedotovs closed 3 months ago
Inconsistent Data Lengths: The error All arrays must be of the same length suggests that when constructing a DataFrame, the lists or arrays provided as data have different lengths, which is not allowed in Pandas. This likely causes the DataFrame construction to fail, resulting in a NoneType object.
AttributeError on to_csv: The error AttributeError: 'NoneType' object has no attribute 'to_csv' indicates that ogre_city_data_frame is None, which happens because the DataFrame creation failed due to the previous error.
Proposed fix example
Check Data Lengths Before Creating DataFrame Ensure that all the arrays or lists you are using to create the DataFrame have the same length.
Root cause why dataFrame creation function call failed is inconsistent attribute count for all ad entries:
Ogre-raw-data-report-2024-08-07.txt - consistent attribute count
96 Date
96 https
Ogre-raw-data-report-2024-08-08.txt - consistent attribute count
61 Date
61 https
Ogre-raw-data-report-2024-08-10.txt - fails
81 Date <<< for each ad attribute count is NOT consistent
82 https <<<
Ogre-raw-data-report-2024-08-11.txt - fails
143 Date <<< for each ad attribute count is NOT consistent
144 https <<<
Issue has been resolved in 8b6aa3d
Detected in:
Error from WS log files