Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading FCA results in invalid countries #12

Closed
glourencoffee opened this issue Sep 17, 2022 · 0 comments
Closed

Reading FCA results in invalid countries #12

glourencoffee opened this issue Sep 17, 2022 · 0 comments
Labels
Priority: Medium Issue should be integrated in the next release Status: Completed This issue has been solved and can be integrated to development branch Type: Bug Something isn't behaving as expected
Milestone

Comments

@glourencoffee
Copy link
Owner

Description

Reading FCA files shows messages saying that some countries are invalid.

Steps to reproduce

  1. Download the FCA of 2017
  2. Open it with cvm.fca_reader()
  3. Iterate through it until exhaustion

Expected behavior

Reading countries from FCA documents shouldn't result in any failure messages. Country fields should be thus optional. If a country is valid, a Country object corresponding to that country should be created. Otherwise, a warning message should be printed to inform that a country name is unknown, and None should be used instead.

This library may also interpret typos, such as "Brasi" and "Espanhã", and translate them to their corresponding Country.

Actual behavior

FCA of 2017 results in the following messages related to invalid country, some of which are errors:

Skipping line 2 in trading admissions batch 65209: failed to create object from value 'Inglaterra' at field 'Pais': 'Inglaterra' is not a valid Country
Skipping line 1 in addresses batch 62885: failed to create object from value 'Espanhã' at field 'Pais': 'Espanhã' is not a valid Country
Skipping line 2 in addresses batch 62885: failed to create object from value 'Espanhã' at field 'Pais': 'Espanhã' is not a valid Country
Error while reading issuer company: failed to create object from value 'BR' at field 'Pais_Custodia_Valores_Mobiliarios': 'BR' is not a valid Country
Error while reading issuer company: failed to create object from value '...............' at field 'Pais_Custodia_Valores_Mobiliarios': '...............' is not a valid Country
Error while reading issuer company: failed to create object from value 'Não aplicável' at field 'Pais_Custodia_Valores_Mobiliarios': 'Não aplicável' is not a valid Country
Skipping line 1 in addresses batch 63634: failed to create object from value 'Brasi' at field 'Pais': 'Brasi' is not a valid Country
Error while reading issuer company: failed to create object from value 'N/A' at field 'Pais_Custodia_Valores_Mobiliarios': 'N/A' is not a valid Country
Error while reading issuer company: failed to create object from value 'Não aplicável' at field 'Pais_Custodia_Valores_Mobiliarios': 'Não aplicável' is not a valid Country
Skipping line 3 in trading admissions batch 66027: failed to create object from value 'EUA' at field 'Pais': 'EUA' is not a valid Country

Additional context

This is another bug like #9 which is not coming from this library, but rather from CVM's side. It seems the ENET software does not enforce valid name for countries, which results in country names such as "Espanhã", "Brasi", or even "..............." (LOL).

@glourencoffee glourencoffee added this to the 0.3.0 milestone Sep 17, 2022
@glourencoffee glourencoffee transferred this issue from another repository Oct 11, 2022
@glourencoffee glourencoffee transferred this issue from another repository Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Medium Issue should be integrated in the next release Status: Completed This issue has been solved and can be integrated to development branch Type: Bug Something isn't behaving as expected
Projects
None yet
Development

No branches or pull requests

1 participant