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

Bugfix/python snippets #1718

Merged
merged 6 commits into from
Aug 21, 2023
Merged

Bugfix/python snippets #1718

merged 6 commits into from
Aug 21, 2023

Conversation

samwelkanda
Copy link
Contributor

@samwelkanda samwelkanda commented Aug 17, 2023

Overview

Resolves bugs in Python Snippets
Fixes: microsoftgraph/microsoft-graph-explorer-v4#2738

Demo

Optional. Screenshots, curl examples, etc.

Notes

Optional. Ancillary topics, caveats, alternative strategies that didn't work out, anything else.

Testing Instructions

  • How to test this PR
  • Prefer bulleted description
  • Start after checking out this branch
  • Include any setup required, such as bundling scripts, restarting services, etc.
  • Include test case, and expected output

@samwelkanda samwelkanda marked this pull request as ready for review August 17, 2023 11:42
@samwelkanda samwelkanda requested a review from a team as a code owner August 17, 2023 11:42
var snippetModel = new SnippetModel(requestPayload, ServiceRootUrl, await GetV1SnippetMetadata());
var result = _generator.GenerateCodeSnippet(snippetModel);
Assert.Contains("request_body = Message(", result);
Assert.Contains("received_date_time = \"2021-08-30T20:00:00:00Z\"", result);
Copy link
Member

Choose a reason for hiding this comment

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

Should this be translated to an equivalent python DateTime object? Or are they represented as strings?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The default datetime package doesn't cover all the datetime formats well, so we leverage a third party package dateutil for parsing during serialization/deserialization. If you pass a native datetime object, or a string both will work well.

samwelkanda and others added 3 commits August 18, 2023 15:26
…tor.cs

Co-authored-by: Eastman <andrueastman@users.noreply.github.com>
…tor.cs

Co-authored-by: Eastman <andrueastman@users.noreply.github.com>
@sonarcloud
Copy link

sonarcloud bot commented Aug 18, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

91.1% 91.1% Coverage
0.0% 0.0% Duplication

@andrueastman andrueastman merged commit 1831029 into dev Aug 21, 2023
9 checks passed
@andrueastman andrueastman deleted the bugfix/python-snippets branch August 21, 2023 07:59
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.

Code snippets clean up
2 participants