Skip to content

Commit

Permalink
Breaking change to generating URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
mesozoic committed Oct 30, 2024
1 parent c70dba7 commit 6779baa
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
4 changes: 3 additions & 1 deletion docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,14 @@ Changelog
- `PR #395 <https://github.com/gtalarico/pyairtable/pull/395>`_
* Dropped support for Pydantic 1.x.
- `PR #397 <https://github.com/gtalarico/pyairtable/pull/397>`_
* Refactored methods/properties for constructing URLs in the API.
- `PR #399 <https://github.com/gtalarico/pyairtable/pull/399>`_

2.3.4 (2024-10-21)
------------------------

* Fixed a crash at import time under Python 3.13.
`PR #396 <https://github.com/gtalarico/pyairtable/pull/396>`_
- `PR #396 <https://github.com/gtalarico/pyairtable/pull/396>`_

2.3.3 (2024-03-22)
------------------------
Expand Down
31 changes: 31 additions & 0 deletions docs/source/migrations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,37 @@ Deprecated metadata module removed
The 3.0 release removed the ``pyairtable.metadata`` module. For supported alternatives,
see :doc:`metadata`.

Changes to generating URLs
---------------------------------------------

The following properties and methods for constructing URLs have been renamed or removed.
These methods now return instances of :class:`~pyairtable.utils.Url`, which is a
subclass of ``str`` that has some overloaded operators. See docs for more details.

.. list-table::
:header-rows: 1

* - Building a URL in 2.x
- Building a URL in 3.0
* - ``table.url``
- ``table.urls.records``
* - ``table.record_url(record_id)``
- ``table.urls.record(record_id)``
* - ``table.meta_url("one", "two")``
- ``table.urls.meta / "one" / "two"``
* - ``table.meta_url(*parts)``
- ``table.urls.meta // parts``
* - ``base.url``
- (removed; was invalid)
* - ``base.meta_url("one", "two")``
- ``base.urls.meta / "one" / "two"``
* - ``base.webhooks_url()``
- ``base.urls.webhooks``
* - ``enterprise.url``
- ``enterprise.urls.meta``
* - ``workspace.url``
- ``workspace.urls.meta``

Changes to the formulas module
---------------------------------------------

Expand Down
6 changes: 5 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ commands =
[testenv:coverage]
passenv = COVERAGE_FORMAT
commands =
python -m pytest -m 'not integration' --cov=pyairtable --cov-report={env:COVERAGE_FORMAT:html} --cov-fail-under=100
python -m pytest -m 'not integration' \
--cov=pyairtable \
--cov-report={env:COVERAGE_FORMAT:html} \
--cov-report=term-missing \
--cov-fail-under=100

[testenv:docs]
basepython = python3.9
Expand Down

0 comments on commit 6779baa

Please sign in to comment.