Octue

Latest version: v0.61.0

Safety actively analyzes 688823 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 40

0.56.0

Summary
This release makes major improvements to event handling and question auditing. Some of the main changes are:
- Questions are now automatically associated with their parent question and the question that originated them, however deep they are in a question tree
- Events are ordered by datetime by the event backend, not the SDK
- Better feedback is provided when asking questions in parallel
- You can specify the event store to use
- Log message contexts have been slimmed down without losing any information, and events are replayable with no context (good for smaller screens)
- Various public classes and functions are faster and easier to use
- Question retries have the same question UUID

<!--- SKIP AUTOGENERATED NOTES --->
Contents ([660](https://github.com/octue/octue-sdk-python/pull/660))

**IMPORTANT:** There are 6 breaking changes.

New features
Events
- 💥 **BREAKING CHANGE:** Add `parent_question_uuid`, `originator_question_uuid`, `originator` and `retry_count` event attributes
- Avoid redelivery of questions by checking the event store on delivery

Event handlers
- Add ability to not include service metadata in logs in even handlers
- Enable `EventReplayer` to handle question events
- Add `RegisteredTemporaryDirectory` class, use it when downloading datasets, and add ability to delete them at end of analysis

Enhancements
Resources
- 💥 **BREAKING CHANGE:** Make datasets recursive by default in `Dataset`
- Log a warning if a dataset is empty at instantiation

Services
- 💥 **BREAKING CHANGE:** Remove `name` argument from `Service` and provide an SRUID to `Child` internal service instead of a name
- Improve logging of errors, retries, and threading in `Child.ask_multiple`
- Order pub/sub messages by datetime using ordering key and remove `order` event attribute
- Set question UUIDs in advance in `Child.ask_multiple`

Subscriptions
- Allow existing subscriptions in `create_push_subscription`
- Give feedback on (un)successful push subscription creation in CLI

Questions and events
- Remove unnecessary `sender` argument from `get_events` and make getting the tail of events the default
- Allow retried questions to have the same UUID
- Allow explicit question retries by using `retry_count` attribute
- Return empty list from `get_events` if no events for question

Service configuration
- Allow setting of event store table ID and `delete_local_files` in service configuration
- Use envvar to specify service configuration location by default
- Add `overrides` option to `Runner.from_configuration`

Other
- Log warning when `PYTHONUNBUFFERED` envvar is unset
- Remove "analysis-" from start of question UUIDs in log context

Fixes
- 💥 **BREAKING CHANGE:** Return question UUID alongside error from `Child.ask_multiple` for failed questions
- Set analysis ID at start of `Runner.run`
- Emit correct logs when no diagnostics available with `octue get-diagnostics`
- Fix deserialisation of events in `get_events`
- Use (meta-)generation agnostic retry strategy with cloud storage
- Return correct question UUIDs with failed questions from `Child.ask_multiple`
- Avoid logging that app failed when it didn't when uploading diagnostics
- Allow setting of `max_workers` when CPU count is indeterminate
- Disable `delete_local_files` by default

Operations
- Update event handler and its bigquery table

Dependencies
- Loosen `Sphinx` and other docs package ranges
- Remove unneeded `db-dtypes` package
- Make `google-cloud-bigquery` a mandatory dependency
- Upgrade `google-cloud-secret-manager`

Refactoring
Event handlers
- 💥 **BREAKING CHANGE:** Remove redundant datetime from delivery ack and heartbeat events
- 💥 **BREAKING CHANGE:** Rename `originator` event attribute to `parent`
- Factor out finalising and cleaning up in `Runner`
- Move service accounts into separate terraform file
- Cache metadata against datafile/dataset instead of path
- Rename python3.9 dockerfile to reflect its python version

---
Upgrade instructions
- Add `recursive=False` to `Dataset` instantiations
- Update all services in your service network to use `octue>=0.56.0`
- Use version `0.6.1` of the event handler or above and a correspondingly up-to-date BigQuery table.
- Swap the `internal_service_name` argument for `internal_sruid` argument to `Child.__init__` and provide a valid SRUID
- Instances of `Service` can no longer be given names. Please give them a valid SRUID instead.
- To get the unraised exception from a failed answer returned by `Child.ask_multiple`, access the zeroth element e.g. if the third question failed:

answers = Child.ask_multiple(*questions)
exception, question_uuid = answers[3]

- `Service.received_events`, `AbstractEventHandler.handled_events`, and `Child.received_events` now include event attributes instead of just the event. These attributes/properties now return a list of dictionaries with the keys {"event", "attributes"}, where what was previously returned is now mapped to the "event" key.
- Stop providing the `recipient` argument to `EventReplayer` and `GoogleCloudPubSubEventHandler` - it's now automatically acquired from each event's attributes
- Stop passing the `skip_missing_events_after` argument to `EventReplayer` and `GoogleCloudPubSubEventHandler`
- Stop using the `awaiting_missing_event` and `time_since_missing_event` properties on the event handlers

<!--- END AUTOGENERATED NOTES --->

0.55.0

<!--- SKIP AUTOGENERATED NOTES --->
Contents ([650](https://github.com/octue/octue-sdk-python/pull/650))

**IMPORTANT:** There is 1 breaking change.

Enhancements
- Include received invalid data in flask app error messages
- Allow any iterable for `Dataset` `files` argument

Fixes
- Ensure `order` argument is given in `Service.send_exception`
- Add workaround for apparent bug in getting local metadata file's absolute path
- Remove (now-) unnecessary json decoding in `get_events`

Dependencies
- 💥 **BREAKING CHANGE:** Drop support for python3.7
- Use `twined==0.5.5`
- Update to `black==24.4.2`

Testing
- Remove unnecessary test
- Update asynchronous deployment test to accept numpy array as output values

---
Upgrade instructions
<details>
<summary>💥 <b>Drop support for python3.7</b></summary>

Upgrade to `python>=3.8` to keep using `octue`.
</details>

<!--- END AUTOGENERATED NOTES --->

0.54.0

<!--- SKIP AUTOGENERATED NOTES --->
Contents ([647](https://github.com/octue/octue-sdk-python/pull/647))

**IMPORTANT:** There are 2 breaking changes.

Enhancements
- 💥 **BREAKING CHANGE:** Return question UUID from `Child.ask`
- Deserialise manifests from events in `get_event`
- Raise error if no events found when calling `get_events`

Fixes
- Use correct base image for `python3.11` dockerfile
- Return schema-compliant events and attributes from `get_events`

Operations
- Import missing APIs into terraform config
- Deploy version `0.5.0` of event handler cloud function and update event store schema
- Update `actions/setup-python` to version 5

Dependencies
- 💥 **BREAKING CHANGE:** Make `db-dtypes` and `google-cloud-bigquery` optional
- Upgrade `gunicorn` to avoid vulnerability
- Loosen `numpy` dependency

Testing
- Test retrieving results from real asynchronous question
- Run tests with `python3.10` (`python3.9` isn't available on `macos-latest` for `arm64`)

Other
- Add DOI badge to readme

---
Upgrade instructions
<details>
<summary>💥 <b>Return question UUID from `Child.ask`</b></summary>

Instead of writing `answer = Child.ask(...)`, write `answer, question_uuid = Child.ask(...)` (and the same for `ChildEmulator`)
</details>

<details>
<summary>💥 <b>Make `db-dtypes` and `google-cloud-bigquery` optional</b></summary>

To keep using the `get_events` function, add the `bigquery` optional extra to your installation command e.g. `poetry install -E bigquery`.
</details>

<!--- END AUTOGENERATED NOTES --->

0.53.0

Not secure
Summary
This pull request:
- Makes the SDK fully event-driven by using a single topic to emit/consume events
- Majorly refactors the event handler to facilitate asynchronous event retrieval
- Adds the ability to get and replay events from a BigQuery store

<!--- SKIP AUTOGENERATED NOTES --->
Contents ([632](https://github.com/octue/octue-sdk-python/pull/632))

**IMPORTANT:** There are 4 breaking changes.

New features
- 💥 **BREAKING CHANGE**: Use single topic per workspace (https://github.com/octue/octue-sdk-python/pull/639)
- Add `get_events` function for retrieving events asynchronously from BigQuery
- Add `EventReplayer` class to replay asynchronously-retrieved events
- Add `Manifest.download` method

Enhancements
- Get subscription project name from topic by default
- Improve asking of asynchronous questions via `Child.ask`
- Return download path from `Dataset.download`
- Include question UUID in delivery acknowledgement log message
- Improve handling of invalid events
- Add `datetime` and `uuid` attributes to all events

Fixes
- Await successful publishing of question messages
- Fix `api_access_endpoint` usage in `mock_generate_signed_url`

Operations
- Add test BigQuery dataset, cloud function, and IAM roles to terraform config
- Switch to reusable workflows where possible

Dependencies
- Add `google-cloud-bigquery`
- Upgrade `coolname`
- Add `db-dtypes` for converting bigquery rows to dataframes

Refactoring
- 💥 **BREAKING CHANGE**: Rename `x.received_messages` to `x.received_events`
- 💥 **BREAKING CHANGE**: Rename `record_messages` parameters to `record_events`
- 💥 **BREAKING CHANGE**: Update `ChildEmulator` to use `event*` instead of `message*`
- Factor out making minimal dictionary
- Factor out creating push subscription
- Factor out emitting question event in `Service.ask`
- Factor out event handlers and related logic from `OrderedMessageHandler` into new `AbstractEventHandler`
- Move `validation` module into `octue.cloud.events` subpackage
- Rename `OrderedMessageHandler` to `GoogleCloudPubSubEventHandler`
- Rename "message" to "event" in event handler classes
- Rename `GooglePubSubHandler` to `GoogleCloudPubSubHandler`

Chores
- Update licence year to 2024

Testing
- Simplify various tests

Upgrade instructions
- Update all services in your services network to this version of `octue` or later (`0.53.0`+)
- Replace any usages of the `received_messages` methods with `received_events`
- Replace any usages of the `record_messages` parameters with `record_events`
- Replace the word `message` with `event` in usages of `ChildEmulator` methods (apart from in the case of `monitor_message`)

<!--- END AUTOGENERATED NOTES --->

0.52.2

Not secure

0.52.1

Not secure
<!--- START AUTOGENERATED NOTES --->
Contents ([627](https://github.com/octue/octue-sdk-python/pull/627))

Enhancements
- Warn about messages with duplicate message numbers

<!--- END AUTOGENERATED NOTES --->

Page 3 of 40

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.