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

Python: Small fixes #7989

Merged
merged 4 commits into from
Jul 25, 2023
Merged

Python: Small fixes #7989

merged 4 commits into from
Jul 25, 2023

Conversation

Fokko
Copy link
Contributor

@Fokko Fokko commented Jul 5, 2023

Uncovered these when upgrading to Pydantic 2.0

Uncovered these when upgrading to Pydantic 2.0
@github-actions github-actions bot added the python label Jul 5, 2023
@Fokko Fokko added this to the PyIceberg 0.4.1 milestone Jul 6, 2023
Copy link
Contributor

@JonasJ-ap JonasJ-ap left a comment

Choose a reason for hiding this comment

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

LGTM! @Fokko Thanks for your great work!

One minor non-blocking suggestion: I think it would be great to update snapshot_id parameter in these tests to use int type, to reflect the improvements made in the PR.

def test_history(table: Table) -> None:
assert table.history() == [
SnapshotLogEntry(snapshot_id="3051729675574597004", timestamp_ms=1515100955770),
SnapshotLogEntry(snapshot_id="3055729675574597004", timestamp_ms=1555100955770),
]

snapshot_log=[
SnapshotLogEntry(snapshot_id="3051729675574597004", timestamp_ms=1515100955770),
SnapshotLogEntry(snapshot_id="3055729675574597004", timestamp_ms=1555100955770),
],

@Fokko
Copy link
Contributor Author

Fokko commented Jul 6, 2023

@JonasJ-ap Great catch!

@GadiZimerman
Copy link

@CodiumAI-Agent

@CodiumAI-Agent
Copy link

PR Analysis

  • 🎯 Main theme: Refactoring the code to improve type annotations and default values
  • 🔍 Description and title: Yes
  • 📌 Type of PR: Refactoring
  • 🧪 Relevant tests added: No
  • Minimal and focused: Yes, the PR is minimal and focused as it only deals with improving type annotations and default values in the code
  • 🔒 Security concerns: No, the PR does not introduce any apparent security concerns as it mainly deals with type annotations and default values

PR Feedback

  • 💡 General PR suggestions: The PR is well-structured and follows good practices. However, it would be beneficial to add tests to ensure that the changes do not introduce any regressions.

  • 🤖 Code suggestions:

    • relevant file: python/pyiceberg/table/init.py
      suggestion content: Consider adding docstrings to the classes and methods to improve code readability and maintainability. [medium]

    • relevant file: python/pyiceberg/table/metadata.py
      suggestion content: Consider using a constant for the default value of 'last_partition_id' instead of 'None' to improve code readability. [medium]

    • relevant file: python/pyiceberg/table/snapshots.py
      suggestion content: Consider adding error handling or checks for the 'snapshot_id' field as it is a critical field. [important]

    • relevant file: python/tests/catalog/test_hive.py
      suggestion content: Consider adding assertions to check the values of the fields in the 'SnapshotLogEntry' objects to ensure they are as expected. [medium]

How to use

Tag me in a comment '@CodiumAI-Agent' to ask for a new review after you update the PR.
You can also tag me and ask any question, for example '@CodiumAI-Agent is the PR ready for merge?'

@Fokko Fokko changed the title Python: Small improvements Python: Small fixes Jul 16, 2023
Copy link
Contributor

@nastra nastra left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @Fokko. And thanks @JonasJ-ap for reviewing

@nastra nastra merged commit 3648b04 into apache:master Jul 25, 2023
7 checks passed
@Fokko Fokko deleted the fd-fix-snapshots branch July 25, 2023 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants