Skip to content

[EAGLE-6151]: change some == to is#570

Merged
zeiler merged 2 commits intomasterfrom
EAGLE-6151-ruff-prep
May 2, 2025
Merged

[EAGLE-6151]: change some == to is#570
zeiler merged 2 commits intomasterfrom
EAGLE-6151-ruff-prep

Conversation

@zeiler
Copy link
Copy Markdown
Member

@zeiler zeiler commented May 2, 2025

In prep for ruff check across the repo, it flags some comparisons that should be is. Making a PR for just that first to see if it makes sense.

@zeiler zeiler requested review from Copilot and luv-bansal May 2, 2025 22:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates several equality comparisons to use the identity operator ("is") for built‐in types in preparation for a broader ruff check. The changes affect comparisons in the method signature utilities and data type utilities to align with modern code style requirements.

  • Updated type checks in clarifai/runners/utils/method_signatures.py (e.g. tuple, list comparisons).
  • Modified equality comparisons in clarifai/runners/utils/data_types.py (e.g. comparing python_type with self.class, str, Text, Image, etc.).

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
clarifai/runners/utils/method_signatures.py Replaced some equality (==) checks with identity (is) comparisons for type checks.
clarifai/runners/utils/data_types.py Updated equality comparisons to use identity (is) for built-in type checks.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2025

Code Coverage

Package Line Rate Health
clarifai 43%
clarifai.cli 43%
clarifai.client 71%
clarifai.client.auth 74%
clarifai.constants 100%
clarifai.datasets 100%
clarifai.datasets.export 80%
clarifai.datasets.upload 75%
clarifai.datasets.upload.loaders 37%
clarifai.models 100%
clarifai.modules 0%
clarifai.rag 72%
clarifai.runners 10%
clarifai.runners.models 67%
clarifai.runners.utils 61%
clarifai.schema 100%
clarifai.urls 80%
clarifai.utils 74%
clarifai.utils.evaluation 67%
clarifai.workflows 94%
Summary 66% (5861 / 8833)

Minimum allowed line rate is 50%

@zeiler zeiler enabled auto-merge (squash) May 2, 2025 22:53
@zeiler zeiler merged commit 2c1c195 into master May 2, 2025
9 checks passed
@zeiler zeiler deleted the EAGLE-6151-ruff-prep branch May 2, 2025 23:00
@srikanthbachala20 srikanthbachala20 mentioned this pull request May 8, 2025
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.

3 participants