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

Add usage instructions README + job state constants + change insert many return #19

Merged
merged 1 commit into from
Jul 5, 2024

Conversation

brandur
Copy link
Contributor

@brandur brandur commented Jul 5, 2024

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.

…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 brandur merged commit a03cc79 into master Jul 5, 2024
3 checks passed
@brandur brandur deleted the brandur-readme branch July 5, 2024 04:00
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`.
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.

1 participant