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
Filtering not applied on related object list views? #113
Comments
* Fix for `2.26.0 (2020-04-14)`_ and `Issue #113`_ * Calls to ``Query.all`` will use initialised its parameters, unless the URI provides its own. * See `PR 123 <https://github.com/gadventures/gapipy/pull/123>`_ * Add the ability to define the ``max_retries`` values on the requestor. * New ``env`` value ``GAPI_CLIENT_MAX_RETRIES`` * The default value will be ``0``, and if provided will override the ``retry`` value on the ``requests.Session``. * This change will also always initialize a ``requests.Session`` value on initialisation of the ``gapipy.Client``. * See `PR 124 <https://github.com/gadventures/gapipy/pull/124>`_ * Add ``variation_id`` field to the ``Image`` resource. * See `Commit edc8d9b <https://github.com/gadventures/gapipy/commit/edc8d9b>`_ * Update the ``ActivityDossier`` and ``AccommodationDOssier`` resources. * Remove the ``is_prepaid`` field * Adds the ``has_costs`` field * See `Commit bd35531 <https://github.com/gadventures/gapipy/commit/bd35531>`_ .. _`Issue #113`: #113
* Fix for `2.26.0 (2020-04-14)`_ and `Issue #113`_. * Calls to ``Query.all`` will use initialised its parameters, unless the URI provides its own. * See `PR 123 <https://github.com/gadventures/gapipy/pull/123>`_. * Add the ability to define the ``max_retries`` values on the requestor. * New ``env`` value ``GAPI_CLIENT_MAX_RETRIES``. * The default value will be ``0``, and if provided will override the ``retry`` value on the ``requests.Session``. * This change will also always initialize a ``requests.Session`` value on initialisation of the ``gapipy.Client``. * See `PR 124 <https://github.com/gadventures/gapipy/pull/124>`_. * Add ``variation_id`` field to the ``Image`` resource. * See `Commit edc8d9b <https://github.com/gadventures/gapipy/commit/edc8d9b>`_. * Update the ``ActivityDossier`` and ``AccommodationDOssier`` resources. * Remove the ``is_prepaid`` field. * Adds the ``has_costs`` field. * See `Commit bd35531 <https://github.com/gadventures/gapipy/commit/bd35531>`_. .. _`Issue #113`: #113
👋 @marz619 I see you closed this -- thanks for following up, but I think that some problems remain. I just wanted to follow up to confirm that the issue had been fixed, but I can't get through the reproduction instructions at all. Can you? I've got
... but I get an Line 184 in 1110dec
That |
I see in your PR you created a namedtuple for that parent arg, but in my stacktrace I get a plain old gapipy/gapipy/resources/tour/tour_dossier.py Lines 56 to 57 in 5fe8ce0
|
I should add: I see the same failure when I do |
@jonprindiville yup, adding the namedtuple broke the way the code functions. 🤦 We can remove that |
1. Adding the _Parent namedtuple in models.base broke this existing behaviour when Querying for departures under a tour-dossier We can remove this, as 1) Tours are deprecated & 2) We use Sieve to paginate through the departures resources under a tour-dossier.
Here's a bit of odd behaviour that I've encountered. I feel like this is in error, but will have to do a bit more digging to be sure.
In the following examples,
g
is a gapipy client with the only options passed in being an application key (the g.com key, in this case).Reproducing
First off, if we fetch a tour_dossier and then access the related departures listing, it can tell us what the count is (from the
count
attr on the JSON responses):If we apply some filter, the count changes appropriately:
If -- instead of calling
.count
on it -- we iterate the result of thefilter
call, we seem to get the full unfiltered set of departures:😢 What happened to my filters? I would expect to see 672 items here, same as where we used
.count
. This is the source of my confusion.Contrast with...
... what happens when we query the departures list view directly, rather than reaching through a tour_dossier:
Filter for all the departures associated with that tour_dossier and we get the same 1247 value:
If we add on our date filter and use
.count
, again we get 672:And here, the expected behaviour -- iterating that filter expression and we encounter the same number of items as when
.count
ing it -- seems like the filtering persists in this case:The text was updated successfully, but these errors were encountered: