Pandahub

Latest version: v0.3.2

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

Scan your dependencies

Page 1 of 2

0.3.2

* add support for timeseries collections
* fix: activate created project by id

**Full Changelog**: https://github.com/e2nIEE/pandahub/compare/v0.3.1...v0.3.2

0.3.1

* [fix: filter asymmetric loads/sgens when getting subnets](https://github.com/e2nIEE/pandahub/commit/9400085cf359f99a8cb8a65cb289ddb32fe8b36b)
* [create indexes with project by default](https://github.com/e2nIEE/pandahub/commit/84c3263d4251338a4c140704f930aec1ba0bca25)
**Full Changelog**: https://github.com/e2nIEE/pandahub/compare/v0.3.0...v0.3.1

0.3.0

What's Changed
* Update fastapi-stack by jthurner in https://github.com/e2nIEE/pandahub/pull/32


**Full Changelog**: https://github.com/e2nIEE/pandahub/compare/v0.2.10...v0.3.0

BREAKING CHANGES:

- existing user collections have to be migrated (recreate with id field moved into _id - see below)
- changed variable names in fastapi-mail: `MAIL_TLS` -> `MAIL_STARTTLS` and `MAIL_SSL` -> `MAIL_SSL_TLS`
- applications integrating pandahub must adapt to changes introduced since [fastapi-users v9](https://fastapi-users.github.io/fastapi-users/12.1/migration/9x_to_10x/) and [fastapi v0.75](https://fastapi.tiangolo.com/release-notes/)

User database migration

pandahub v0.3.0 introduces a breaking change in the way user documents are stored. Log-ins will throw a backend error if you run pandahub >= v0.3.0 against a database containing users created with previous versions.

To migrate an existing database:

python
from pandahub import PandaHub
from pandahub.lib.database_toolbox import migrate_userdb_to_beanie
ph = PandaHub()
migrate_userdb_to_beanie(ph)


This migration breaks logins for pandahub < 0.3.0. Trying to create new users with an old pandahub version on a migrated database will fail if at least one user already exists. A backup of the original user collection will be created as `users_fa9_%Y-%m-%d_%H-%M`.

Background
[fastapi-users](https://fastapi-users.github.io), which pandahub depends on for user management, introduces a couple of [breaking changes in version 10](https://fastapi-users.github.io/fastapi-users/12.1/migration/9x_to_10x/). With the switch to [Beanie ODM](https://github.com/roman-right/beanie/) for mongodb support, user ids are now saved on the `_id` field instead of `id`:

fastapi v9
python
{'_id': ObjectId('637f2341304330c7511e4056'), 'id': UUID('2b52cf59-f5c3-433c-963c-834fbe9edbeb'), 'email': 'myuser.com'}

fastapi v10+
python
{'_id': UUID('2b52cf59-f5c3-433c-963c-834fbe9edbeb'), 'email': 'myuser.com'}

To migrate, drop the index on `id` and move the `id` field into `_id`:

python
db["user_management"]["users"].drop_index("id_1")
db["user_management"]["users"].aggregate([{'$addFields': {'_id': '$id'}}, {'$unset': 'id'}, {'$out': 'users'}]


To roll back to pre-0.3.0, apply the reverse transformation:

python
db["user_management"]["users"].aggregate([{'$addFields': {'id': '$_id'}}, {'$unset': '_id'}, {'$out': 'users'}]`

0.2.10

What's Changed
* Fix performance issue in get_subnet with large collections lthurner in https://github.com/e2nIEE/pandahub/commit/677a4dd9587fa984bcdbc144b5deabf50ecf420d
**Full Changelog**: https://github.com/e2nIEE/pandahub/compare/v0.2.9...v0.2.10

0.2.9

What's Changed
* Refactor functions for element creation and deletion by jthurner in https://github.com/e2nIEE/pandahub/pull/39
* added collection_name to GetTimeseriesModel for API calls by jthurner in https://github.com/e2nIEE/pandahub/pull/40
* Custom element filters for get_subnet by jthurner in https://github.com/e2nIEE/pandahub/pull/41
* Set mongodb indexes on project creation by jthurner in https://github.com/e2nIEE/pandahub/pull/36


**Full Changelog**: https://github.com/e2nIEE/pandahub/compare/v0.2.8...v0.2.9

0.2.8

What's Changed
* Fix: Return value of `create_elements_in_db` by lhillma in https://github.com/e2nIEE/pandahub/pull/34


**Full Changelog**: https://github.com/e2nIEE/pandahub/compare/v0.2.7...v0.2.8

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.