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

fix trying to iterate over NoneType #1256

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jacklanchantin
Copy link
Contributor

Description

Sometimes there are no items in the world spec. Unless that itself is a bug, this fixes the bug of trying to iterate over items of type None.

Fixes # (issue)

Type of change

Please check the options that are relevant.

  • Bug fix (non-breaking change that fixes an issue)
  • Proposes a change (non-breaking change that isn't necessarily a bug)
  • Refactor
  • New feature (non-breaking change that adds a new functionality)
  • Breaking change (fix or feature that would break some existing functionality downstream)
  • This is a unit test
  • Documentation only change
  • Datasets Release
  • Models Release

Type of requested review

  • I want a thorough review of the implementation.
  • I want a high level review.
  • I want a deep design review.

Before and After

before: spec.get("items")
after: spec.get("items", [])

Testing

Please describe the tests that you ran to verify your changes and how we can reproduce.

Checklist:

  • I have performed manual end-to-end testing of the feature in my environment.
  • I have added Docstrings and comments to the code.
  • I have made changes to existing documentation where needed.
  • I have added tests that show that the PR is functional.
  • New and existing unit tests pass locally with my changes.
  • I have added relevant collaborators to review the PR before merge.
  • [Polymetis only] I ran on hardware (1) all scripts in tests/scripts, (2) asv benchmarks.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 23, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #1256 (3bdf77e) into main (5c0ff21) will decrease coverage by 0.08%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1256      +/-   ##
==========================================
- Coverage   34.00%   33.92%   -0.09%     
==========================================
  Files         352      352              
  Lines       34848    34848              
==========================================
- Hits        11851    11823      -28     
- Misses      22997    23025      +28     
Impacted Files Coverage Δ
agents/_agent.py 40.92% <0.00%> (-10.82%) ⬇️
lowlevel/minecraft/pyworld/fake_mobs.py 88.13% <0.00%> (ø)

Copy link
Contributor

@aszlam aszlam left a comment

Choose a reason for hiding this comment

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

I am going to be rewriting a lot of this today, but this is fine for now to merge if its blocking

@jacklanchantin
Copy link
Contributor Author

I am going to be rewriting a lot of this today, but this is fine for now to merge if its blocking

It's not blocking since I'm not generating data right now. So I'll leave it un-merged.

@facebook-github-bot
Copy link

Hi @jacklanchantin!

Thank you for your pull request.

We require contributors to sign our Contributor License Agreement, and yours needs attention.

You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants