Skip to content

Add mapping for complex attributes #1154

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

Merged
merged 2 commits into from
Apr 22, 2025
Merged

Conversation

RogerSelwyn
Copy link
Contributor

#684

In support of this issue, this adds the ability to convert a select attribute from a simple attribute to a complex one required by MS Graph.

Copy link
Member

@alejcas alejcas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First I have write a new Query class that I want to replace the old one.
You can check it here.

Also I've added a comment on a line that needs to change.

@alejcas alejcas merged commit ea6a8cc into O365:master Apr 22, 2025
@alejcas
Copy link
Member

alejcas commented Apr 22, 2025

Also, I will be thankful if you can try the new Query.
It works like this:

# here you have you account set up:
from O365.utils import ExperimentalQuery

builder = ExperimentalQuery(protocol=account.protocol)

query = builder.equals("name", "James") | builder.equals("address", "[email protected]")
query = query & builder.orderby("name", "address")

# then use query as where the old query was used in the same way

For example to add select just mix whatever part with builder.select with the & operator

@alejcas
Copy link
Member

alejcas commented Apr 22, 2025

Also, I will be thankful if you can try the new Query. It works like this:

The reasons for a new query builder are:

  • Allows for more deep operations like using iterator like any or all over complex attributes or deep collections
  • It's way more simple and error prone.
  • It allows for the use of & and | operators (but also implements `builder.chain_and/chain_or")
  • It allows to group filters explicitly in the way you like with builder.group
  • It properly manages the negate condition being explicit about it's use with builder.negate

@RogerSelwyn RogerSelwyn deleted the issue_684 branch April 24, 2025 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants