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

[BUG] operator set_progress error #4387

Closed
1 of 3 tasks
yrrah opened this issue May 10, 2024 · 1 comment
Closed
1 of 3 tasks

[BUG] operator set_progress error #4387

yrrah opened this issue May 10, 2024 · 1 comment
Labels
bug Bug fixes

Comments

@yrrah
Copy link

yrrah commented May 10, 2024

Describe the problem

The source comments indicate that set_progress should accept a float & string...

progress (None): an optional float between 0 and 1 (0% to 100%)
label (None): an optional label to display

...but later attempts to access progress.progress
self.log(f"Progress: {progress.progress} - {progress.label}")

Proposed fix:
self.log(f"Progress: {progress} - {label}")

Code to reproduce issue

class SetProgressError(foo.Operator):
    @property
    def config(self):
        return foo.OperatorConfig(
            name="set_progress_error",
            label="Set Progress Error"
        )

    def execute(self, ctx):
        ctx.set_progress(progress=0.5,label="half way") 

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 22.04): Ubuntu 20.04.6 LTS
  • Python version (python --version): Python 3.10.13
  • FiftyOne version (fiftyone --version): v0.23.7
  • FiftyOne installed from (pip or source): pip

Other info/logs

  File "/usr/local/lib/python3.10/dist-packages/fiftyone/operators/executor.py", line 728, in set_progress
    self.log(f"Progress: {progress.progress} - {progress.label}")
AttributeError: 'float' object has no attribute 'progress'

Willingness to contribute

The FiftyOne Community encourages bug fix contributions. Would you or another
member of your organization be willing to contribute a fix for this bug to the
FiftyOne codebase?

  • Yes. I can contribute a fix for this bug independently
  • Yes. I would be willing to contribute a fix for this bug with guidance
    from the FiftyOne community
  • No. I cannot contribute a bug fix at this time
@brimoor
Copy link
Contributor

brimoor commented May 23, 2024

@yrrah thanks for catching this 😅

Fixed in #4417 and will be released in fiftyone==0.24.0 (coming next week).

@brimoor brimoor closed this as completed May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug fixes
Projects
None yet
Development

No branches or pull requests

2 participants