You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using version 0.10.4 from pysus.online_data.SIA import download download('BA', 2024, 4, groups = ["BI"])
Which refers to:
def format(self, file: File) -> tuple:
if file.extension.upper() in [".DBC", ".DBF"]:
digits = ''.join([d for d in file.name if d.isdigit()])
print("This",file.name.split(digits))
chars, _ = file.name.split(digits) # This line crashes
year, month = digits[:2], digits[2:]
group, _uf = chars[:-2].upper(), chars[-2:].upper()
return group, _uf, zfill_year(year), month
return ()
After receiving lots of values like this ['BIMG', ''] which is easily unpacked, I got a ['BIMG2305_1'] which can't be unpacked as a tuple.
My shortfix was to extract the List's first item [0] however I don't know if this solution can be used for all files. It also raised a doubt if this logic is reproduced in the other libraries.
The text was updated successfully, but these errors were encountered:
It seems that now Datasus is splitting the larger files in two for the bigger states: half of the data goes into BIMG2305_1 and the other half into BIMG2305_2 in your example. @luabida can you add a rule to handle this?
How to reproduce my error
Using version 0.10.4
from pysus.online_data.SIA import download
download('BA', 2024, 4, groups = ["BI"])
Which refers to:
After receiving lots of values like this ['BIMG', ''] which is easily unpacked, I got a ['BIMG2305_1'] which can't be unpacked as a tuple.
My shortfix was to extract the List's first item [0] however I don't know if this solution can be used for all files. It also raised a doubt if this logic is reproduced in the other libraries.
The text was updated successfully, but these errors were encountered: