Skip to content

refactor: add py3.12 and py3.13 to tests#1212

Open
JGSweets wants to merge 15 commits into
capitalone:mainfrom
JGSweets:update-py-versions
Open

refactor: add py3.12 and py3.13 to tests#1212
JGSweets wants to merge 15 commits into
capitalone:mainfrom
JGSweets:update-py-versions

Conversation

@JGSweets

@JGSweets JGSweets commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

this pr:

  • refactors to utilize py3.12 and py3.13
  • many updates for mypy consistency across py3.10->py3.13

@JGSweets
JGSweets requested a review from a team as a code owner July 6, 2026 15:45
@JGSweets

JGSweets commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

@shania-m I'm updating the tests here to run py3.12 and py3.13
This should help future proof. However, I think we should remove py3.10 soon

We would love a release of the DP as soon as possible after this merges! Thanks!

other1._median_abs_dev_is_enabled and other2._median_abs_dev_is_enabled
)

@property

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

biggest change is here. but it matches the other class functionalities of being properties and not methods.

:return:
"""
profile = NumericStatsMixin.profile(self)
profile = cast(dict, NumericStatsMixin.profile.__get__(self, type(self)))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

you can see the change have an effect here from making it a property instead of a method

:return:
"""
return NumericStatsMixin.profile(self)
return cast(dict, NumericStatsMixin.profile.__get__(self, type(self)))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

you can see the change have an effect here from making it a property instead of a method

:rtype: Profile
"""
calcs_dict_keys = self._NumericStatsMixin__calculations.keys()
profile = self.profile()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

you can see the change have an effect here from making it a property instead of a method

pass

def _need_to_reconstruct_model(self) -> bool:
pass

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

a change, but should be inconsequential and matches the typing

previously would return None now it returns False

pass

def _need_to_reconstruct_model(self) -> bool:
pass

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

a change, but should be inconsequential and matches the typing

previously would return None now it returns False

MCM[:, 1, 0] = np.sum(
conf_matrix * (np.ones(num_labels) - np.eye(num_labels)), axis=1
non_diagonal_mask = cast(
np.ndarray, np.logical_not(np.eye(num_labels, dtype=bool)).astype(np.int64)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

small change here

strategy:
matrix:
python-version: ["3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12", "3.13"]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added newest python


steps:
- uses: actions/checkout@v4
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4.3.1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

C1 requires commit sha? was denied v4 and v5 on first commit

Comment thread tox.ini
@@ -1,5 +1,5 @@
[tox]
envlist = py39, py310, py311, pypi-description, manifest, precom
envlist = py310, py311, py312, py313, pypi-description, manifest, precom

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

remove old and add new

Comment thread setup.cfg
line_length=88

[mypy]
files = dataprofiler

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

mypy will actually utilize this in our testing now

Comment thread .pre-commit-config.yaml
# https://github.com/pre-commit/mirrors-mypy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.982
rev: v1.11.2

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

updated mypy

Comment thread .pre-commit-config.yaml
rev: v1.11.2
hooks:
- id: mypy
exclude: (^dataprofiler/tests/|^resources/|^examples|venv*/|versioneer.py|dataprofiler/_version.py|_docs/)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this exclude is for pre-commit, but mypy doesn't utilize it hence the updates here

@socket-security

socket-security Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedpypi/​pyarrow@​24.0.0 ⏵ 23.0.173100100100100 +31

View full report

@socket-security

socket-security Bot commented Jul 6, 2026

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
License policy violation: pypi pyarrow

License: Apache-2.0 WITH LLVM-exception - The applicable license policy does not permit this license (5) (pyarrow-23.0.1.dist-info/licenses/LICENSE.txt)

License: Apache-2.0 WITH LLVM-exception - The applicable license policy does not permit this license (5) (pyarrow-23.0.1.dist-info/licenses/LICENSE.txt)

From: requirements.txtpypi/pyarrow@23.0.1

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore pypi/pyarrow@23.0.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
License policy violation: pypi pyarrow

License: Apache-2.0 WITH LLVM-exception - The applicable license policy does not permit this license (5) (pyarrow-23.0.1.dist-info/licenses/LICENSE.txt)

License: Apache-2.0 WITH LLVM-exception - The applicable license policy does not permit this license (5) (pyarrow-23.0.1.dist-info/licenses/LICENSE.txt)

From: requirements.txtpypi/pyarrow@23.0.1

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore pypi/pyarrow@23.0.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
License policy violation: pypi pyarrow

License: Apache-2.0 WITH LLVM-exception - The applicable license policy does not permit this license (5) (pyarrow-23.0.1.dist-info/licenses/LICENSE.txt)

License: Apache-2.0 WITH LLVM-exception - The applicable license policy does not permit this license (5) (pyarrow-23.0.1.dist-info/licenses/LICENSE.txt)

From: requirements.txtpypi/pyarrow@23.0.1

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore pypi/pyarrow@23.0.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
License policy violation: pypi pyarrow

License: Apache-2.0 WITH LLVM-exception - The applicable license policy does not permit this license (5) (pyarrow-23.0.1.dist-info/licenses/LICENSE.txt)

License: Apache-2.0 WITH LLVM-exception - The applicable license policy does not permit this license (5) (pyarrow-23.0.1.dist-info/licenses/LICENSE.txt)

From: requirements.txtpypi/pyarrow@23.0.1

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore pypi/pyarrow@23.0.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
License policy violation: pypi pyarrow

License: Apache-2.0 WITH LLVM-exception - The applicable license policy does not permit this license (5) (pyarrow-23.0.1.dist-info/licenses/LICENSE.txt)

License: Apache-2.0 WITH LLVM-exception - The applicable license policy does not permit this license (5) (pyarrow-23.0.1.dist-info/licenses/LICENSE.txt)

From: requirements.txtpypi/pyarrow@23.0.1

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore pypi/pyarrow@23.0.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
License policy violation: pypi pyarrow

License: Apache-2.0 WITH LLVM-exception - The applicable license policy does not permit this license (5) (pyarrow-23.0.1.dist-info/licenses/LICENSE.txt)

License: Apache-2.0 WITH LLVM-exception - The applicable license policy does not permit this license (5) (pyarrow-23.0.1.dist-info/licenses/LICENSE.txt)

From: requirements.txtpypi/pyarrow@23.0.1

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore pypi/pyarrow@23.0.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
License policy violation: pypi pyarrow

License: Apache-2.0 WITH LLVM-exception - The applicable license policy does not permit this license (5) (pyarrow-23.0.1.dist-info/licenses/LICENSE.txt)

License: Apache-2.0 WITH LLVM-exception - The applicable license policy does not permit this license (5) (pyarrow-23.0.1.dist-info/licenses/LICENSE.txt)

From: requirements.txtpypi/pyarrow@23.0.1

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore pypi/pyarrow@23.0.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@JGSweets

JGSweets commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

@shania-m this is ready for review. Looks like we needed a lot of mypy updates and some almostequal updtes for the new py versions

# popping vocab and comparing as set below since order is random
serialized_vocab = serialized_dict["data"].pop("vocab")

serialized = json.dumps(serialized_dict)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

tests are the same, but now using almostequal for the assert on floats

@JGSweets

JGSweets commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

@shania-m this is ready for review!

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.

1 participant