Piccolo

Latest version: v1.22.0

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

Scan your dependencies

Page 2 of 53

1.17.1

------

Fixed a bug with migrations, where altering a column type from ``Integer`` to
``Float`` could fail. Thanks to kurtportelli for reporting this issue.

-------------------------------------------------------------------------------

1.17.0

------

Each migration is automatically wrapped in a transaction - this can now be
disabled using the ``wrap_in_transaction`` argument:

.. code-block:: python

manager = MigrationManager(
wrap_in_transaction=False,
...
)

This is useful when writing a manual migration, and you want to manage all of
the transaction logic yourself (or want multiple transactions).

``granian`` is now a supported server in the ASGI templates. Thanks to
sinisaos for this.

-------------------------------------------------------------------------------

1.16.0

------

Added custom async ``TestCase`` subclasses, to help with testing.

For example ``AsyncTransactionTest``, which wraps each test in a transaction
automatically:

.. code-block:: python

class TestBandEndpoint(AsyncTransactionTest):

async def test_band_response(self):
"""
Make sure the endpoint returns a 200.
"""
This data automatically gets removed from the database when the
test finishes:
band = Band({Band.name: "Pythonistas"})
await band.save()

Using an API testing client, like httpx:
response = await client.get(f"/bands/{band.id}/")
self.assertEqual(response.status_code, 200)

And ``AsyncTableTest``, which automatically creates and drops tables:

.. code-block:: python

class TestBand(AsyncTableTest):

These tables automatically get created and dropped:
tables = [Band]

async def test_band(self):
...

-------------------------------------------------------------------------------

1.15.0

------

Improved ``refresh`` - it now works with prefetched objects. For example:

.. code-block:: python

>>> band = await Band.objects(Band.manager).first()
>>> band.manager.name
"Guido"

If the manager has changed in the database, when we refresh the band, the
manager object will also be updated:
>>> await band.refresh()
>>> band.manager.name
"New name"

Also, improved the error messages when creating a ``BaseUser`` - thanks to
haaavk for this.

-------------------------------------------------------------------------------

1.14.0

------

Laying the foundations for alterative Postgres database drivers (e.g.
``psqlpy``). Thanks to insani7y and chandr-andr for their help with this.

.. warning::
The SQL generated by Piccolo changed slightly in this release. Aliases used
to be like ``"manager$name"`` but now they are like ``"manager.name"``
(note ``$`` changed to ``.``). If you are using ``SelectRaw`` in your queries
to refer to these columns, then they will need updating. Please let us know
if you encounter any other issues.

-------------------------------------------------------------------------------

1.13.1

------

In Piccolo ``1.6.0`` we moved some aggregate functions to a new file. We now
re-export them from their original location to keep backwards compatibility.
Thanks to sarvesh-deserve for reporting this issue.

-------------------------------------------------------------------------------

Page 2 of 53

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.