Skip to content
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

🐛 Bug Report: Query not valid: Query type does not match expected: double on python SDK #5650

Open
2 tasks done
ZigaMatjaz opened this issue Jun 3, 2023 · 12 comments
Open
2 tasks done
Assignees
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed product / databases Fixes and upgrades for the Appwrite Database.

Comments

@ZigaMatjaz
Copy link

👟 Reproduction steps

Bug is triggered when I try to use the between Query on a float attribute.

👍 Expected behavior

The query should work as the provided parameters are both float and a result should be returned.

👎 Actual Behavior

I got the error specified in the title.

🎲 Appwrite version

Version 1.3.x

💻 Operating system

Linux

🧱 Your Environment

I run appwrite on a digitalocean droplet (marketplace appwrite premade droplet)

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@ZigaMatjaz ZigaMatjaz added the bug Something isn't working label Jun 3, 2023
@stnguyen90 stnguyen90 added the product / databases Fixes and upgrades for the Appwrite Database. label Jun 3, 2023
@stnguyen90
Copy link
Contributor

stnguyen90 commented Jun 3, 2023

@ZigaMatjaz, thanks for raising this issue!

There seems to be a problem with how were parsing and validating the query on the back end. It gets sent to the server has between("attr", [start, end]) but the validation expects input like between("attr", start, end).

Source: https://github.com/utopia-php/database/blob/d821d1f18dfe83b0350ed208be3658764aec99d7/src/Database/Query.php#L350

For now, I suggest using the greater than and less than queries instead.

@stnguyen90 stnguyen90 added good first issue Good for newcomers help wanted Extra attention is needed labels Jun 16, 2023
@Ronakkkkk
Copy link

Please assign if available.

@EraKin575
Copy link

please assign this issue to me

@joeyouss
Copy link

joeyouss commented Aug 8, 2023

Hi @Ronakkkkk you can go ahead, if you are not available to work on this, @EraKin575 can take it up after you

@KanniShashankh
Copy link

Can i work on this issue?

@stnguyen90
Copy link
Contributor

@Ronakkkkk, how's your progress on this? FYI, I'll have to assign you due to inactivity soon.

@stnguyen90 stnguyen90 self-assigned this Sep 15, 2023
@stnguyen90
Copy link
Contributor

@EraKin575, would you like to work on this?

@EraKin575
Copy link

ofcourse

@stnguyen90
Copy link
Contributor

@EraKin575, assigned! I appreciate your interest! 🙏🏼

@stnguyen90 stnguyen90 removed their assignment Sep 22, 2023
@xuelink
Copy link
Contributor

xuelink commented Sep 27, 2023

@ZigaMatjaz

const minDate = new Date();
minDate.setFullYear(minDate.getFullYear() - filterData?.maxAge);
const maxDate = new Date();
maxDate.setFullYear(maxDate.getFullYear() - filterData?.minAge);

Query.between("birthdate", minDate.toDateString(), maxDate.toDateString())
// Query.between("birthdate", minDate, maxDate)
AppwriteException: Invalid query: Query type does not match expected: datetime

Query.between only accept number or string

@EraKin575 When you try to focus this issue, please focus it for not only for the float type but also datetime type solutions for Query.between(). Big Thanks!

@krishnaa192
Copy link

Can I work on this issue?

@stnguyen90
Copy link
Contributor

@EraKin575, how's your progress? FYI, I'll need to unassign you soon due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed product / databases Fixes and upgrades for the Appwrite Database.
Projects
None yet
Development

No branches or pull requests

9 participants