Don't raise InvalidOperation for collection.bulk_write with zero requests

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Fix
    • Priority: Minor - P4
    • None
    • Affects Version/s: 3.7.2
    • Component/s: Error Handling
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When executing `collection.bulk_write(requests)`, if `requests` is an empty list, a `pymongo.errors.InvalidOperation: No operations to execute` error is raised. I feel that this command should simply be a no-op. I find myself having to wrap `bulk_write` calls with e.g. `if requests:`. Why is this operation considered "invalid"? Thanks.

            Assignee:
            Bernie Hackett
            Reporter:
            Donald Winston
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: