QueryEntitiesOptions ignores filter #641

Closed
brian-swan opened this Issue Dec 12, 2012 · 6 comments

Comments

Projects
None yet
4 participants

When I pass a filter directly to the queryEntities method, I get results that show the filter was applied. However, when I use a QueryEntitiesOptions object and pass the same filter to it, the results indicate that the filter was ignored. For example, this returns the expected data in the partition1 (notice I'm passing the filter directly):

$filter = "PartitionKey eq 'partition1'";
$result = $tableRestProxy->queryEntities("mytable", $filter);

But if I set the filter in an $options object, the filter is ignored (I get results as if I'd passed an empty filter...in my case, all data from partition0 is returned):

$filter = "PartitionKey eq 'partition1'";
$options = new QueryEntitiesOptions();
$options->setFilter($filter);
$result = $tableRestProxy->queryEntities("mytable", $options);

It's implied, but want to explicitly state that this is the QueryEntitiesOptions method on the TableRestProxy class.

QueryEntitiesOptions does not accept $filter as a string (Which is a bit unexpected)

Instead it must be passed through a filter

$options->setFilter(Filter::applyQueryString($filter));

Right. Using Filter::applyQueryString produces the expected results. Should this issue be changed to a DCR? Seems that setFilter should accept a string as an argument.

I agree , it should be accepting a string, it is currently inconsistant with other uses of setFilter by requiring the Filter::applyQueryString.

@devigned devigned removed this from the Backlog/Triage milestone Mar 14, 2016

Member

yaqiyang commented Mar 21, 2016

We have setFilter() methods in the following classes,
ServiceBus\Models\RuleDescription.php
ServiceBus\Models\RuleInfo.php
Table\Models\Query.php
Table\Models\QueryEntitiesOptions.php
Table\Models\QueryTablesOptions.php
Table\TableRestProxy.php

They all take filter as Filter type object, not strings. Can you let me know where we are taking filter as string?
Thanks
Yaqi

@yaqiyang yaqiyang added this to the Need More Info milestone Mar 21, 2016

Member

yaqiyang commented Apr 1, 2016

Please reopen the issue if you get this problem again.

Thanks
Yaqi

@yaqiyang yaqiyang closed this Apr 1, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment