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

SG-29997 - FIRST PHASE Python2 removing #352

Merged

Conversation

eduardoChaucaGallegos
Copy link
Contributor

  • ensure_* functions replaced by function from sgutils.py.
  • six types replaced by native

Copy link
Contributor

@julien-lang julien-lang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that you are adding the "ensure_" functions to a module but I don't see them being removed from the six module. Should not we do it?

raise TypeError(f"not expecting type '{type(s)}'")
if isinstance(s, bytes):
s = s.decode(encoding, errors)
return s
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: the two functions don't use the same condition logic.

    if isinstance(s, str):
        return s

    elif isinstance(s, bytes):
        return s.decode(encoding, errors)
 
    raise TypeError(f"not expecting type '{type(s)}'")

Copy link
Contributor

@carlos-villavicencio-adsk carlos-villavicencio-adsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@eduardoChaucaGallegos eduardoChaucaGallegos merged commit 0fef00f into master Jul 19, 2024
24 checks passed
@eduardoChaucaGallegos eduardoChaucaGallegos deleted the ticket/SG-29997-first-phase-python2-removing branch July 19, 2024 17:44
@mathbou
Copy link

mathbou commented Aug 27, 2024

Just a little reminder here, even if it's already merged; most of the work has already been done months ago

@eduardoChaucaGallegos
Copy link
Contributor Author

Just a little reminder here, even if it's already merged; most of the work has already been done months ago

@mathbou Thanks for your collaboration, we have considered your changes for this PR. We did a new PR because we are trying to take less risk and doing this python2 removal in phases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants