Skip to content

[Python] Remove usage of std::to_string and std::stoi #21045

Closed

Description

@asfimport

Not sure why this is happening, but for some older compilers I'm seeing

terminate called after throwing an instance of 'std::invalid_argument'
  what():  stoi

since https://github.com/apache/arrow/pull/3423

Possible cause is that there is no int8_t version of https://en.cppreference.com/w/cpp/string/basic_string/to_string so it might not convert it to a proper string representation of the number.

Any insight on why this could be happening is appreciated.

Reporter: Philipp Moritz / @pcmoritz
Assignee: Yuhong Guo / @guoyuhong

PRs and other links:

Note: This issue was originally created as ARROW-4491. Please see the migration documentation for further details.

Activity

  1. asfimport commented on Feb 6, 2019

    @asfimport
    Author

    Philipp Moritz / @pcmoritz:
    Ok, I think I understand this now. On some implementations, int8_t seems to be a typedef to char and the conversion in this case produces a character and not a number.

  2. asfimport commented on Feb 6, 2019

    @asfimport
    Author

    Antoine Pitrou / @pitrou:
    Yes, this is a pitfall of C++ streams as well. You have to cast to/from a larger integer type.

  3. asfimport commented on Feb 18, 2019

    @asfimport
    Author

    Francois Saint-Jacques / @fsaintjacques:
    I think that @pitrou proposed change is probably the least invasive and require the least effort.

  4. asfimport commented on Feb 26, 2019

    @asfimport
    Author

    Antoine Pitrou / @pitrou:
    Issue resolved by pull request 3758
    #3758

  5. added this to the 0.13.0 milestone on Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions