Add usage instructions README + job state constants + change insert many return#19
Merged
Add usage instructions README + job state constants + change insert many return#19
Conversation
…any return Flesh out the README to add detailed usage instructions. The README also appears on PyPI, so it's nice to have extra information on what to do there. It'll also be very closely mirrored on River's docs site. Also, add job state constants like `JOB_STATE_AVAILABLE`, similar to what's available in Ruby in case anyone needs them (they're useful for use in `UniqueOpts`). Lastly, change the return value of `insert_many`/`insert_many_tx` to be the number of rows inserted instead of a list of inserted jobs to match what's returned in Go and Ruby. The rationale here is that if someone is using the bulk insert functions then they're probably concerned about performance, so it's probably not worth the cost of returning the whole set of jobs back, which are probably used infrequently anyway. These functions aren't implemented yet anyway, so the change isn't a problem.
brandur
added a commit
that referenced
this pull request
Jul 5, 2024
Fix a minor grammar error in the README that came from #19.
brandur
added a commit
that referenced
this pull request
Jul 6, 2024
When I put in job state constants in #19, I didn't think to check first whether there was a concept of real enums in Python. Turns out there is, and we should use one instead of a whole bunch of raw constants. This is a breaking change, but the job states have existed for so little time that I doubt it'll break anybody, so it's worth doing it in this instance.
brandur
added a commit
that referenced
this pull request
Jul 6, 2024
When I put in job state constants in #19, I didn't think to check first whether there was a concept of real enums in Python. Turns out there is, and we should use one instead of a whole bunch of raw constants. This is a breaking change, but the job states have existed for so little time that I doubt it'll break anybody, so it's worth doing it in this instance. And a few other small changes: * Add typing to all exported constants. * Fix an "invalid escape sequence" in the tag validation regex stemming from the `\A` in it by making the string a "raw string" with `r`.
brandur
added a commit
that referenced
this pull request
Jul 6, 2024
When I put in job state constants in #19, I didn't think to check first whether there was a concept of real enums in Python. Turns out there is, and we should use one instead of a whole bunch of raw constants. This is a breaking change, but the job states have existed for so little time that I doubt it'll break anybody, so it's worth doing it in this instance. And a few other small changes: * Add typing to all exported constants. * Fix an "invalid escape sequence" in the tag validation regex stemming from the `\A` in it by making the string a "raw string" with `r`.
brandur
added a commit
that referenced
this pull request
Jul 6, 2024
When I put in job state constants in #19, I didn't think to check first whether there was a concept of real enums in Python. Turns out there is, and we should use one instead of a whole bunch of raw constants. This is a breaking change, but the job states have existed for so little time that I doubt it'll break anybody, so it's worth doing it in this instance. And a few other small changes: * Add typing to all exported constants. * Fix an "invalid escape sequence" in the tag validation regex stemming from the `\A` in it by making the string a "raw string" with `r`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Flesh out the README to add detailed usage instructions. The README also
appears on PyPI, so it's nice to have extra information on what to do
there. It'll also be very closely mirrored on River's docs site.
Also, add job state constants like
JOB_STATE_AVAILABLE, similar towhat's available in Ruby in case anyone needs them (they're useful for
use in
UniqueOpts).Lastly, change the return value of
insert_many/insert_many_txto bethe number of rows inserted instead of a list of inserted jobs to match
what's returned in Go and Ruby. The rationale here is that if someone is
using the bulk insert functions then they're probably concerned about
performance, so it's probably not worth the cost of returning the whole
set of jobs back, which are probably used infrequently anyway. These
functions aren't implemented yet anyway, so the change isn't a problem.