move cloud events to azure core#16661
Conversation
89b5010 to
54f5f3b
Compare
There was a problem hiding this comment.
- ascii is enough, per base64 spec.
- I'm not even sure we need to encode, could you describe the scenario where we do?
There was a problem hiding this comment.
Yeah, this method is confusing to me. Is the only reason for it to exist to normalize the exception type?
There was a problem hiding this comment.
yes - thinking about it, i think we dont need this method at all - removing it
There was a problem hiding this comment.
https://docs.python.org/3/library/datetime.html#datetime.datetime.utcnow
Warning Because naive datetime objects are treated by many datetime methods as local times, it is preferred to use aware datetimes to represent times in UTC. As such, the recommended way to create an object representing the current time in UTC is by calling datetime.now(timezone.utc).
Problem is, Python 2 doesn't have timezone.utc. @johanste usually I tell people to use msrest.serialization.utc since they use msrest as a dependency anyway, but here it won't work. Though?
There was a problem hiding this comment.
I would expect an error if both data and data_base64 are present for clarity
There was a problem hiding this comment.
I agree with it, but if we ever decide to add data_base64 in the future, this error would cause a breaking change - thoughts?
There was a problem hiding this comment.
bad copying ;) - removed it
There was a problem hiding this comment.
I actually find it confusing to have the body in another file here. Could we get rid of the _mock.py file and insert the dict here?
sdk/core/azure-core/CHANGELOG.md
Outdated
xiangyan99
left a comment
There was a problem hiding this comment.
Please separate core changes and event hub changes into different PRs.
There was a problem hiding this comment.
We don't need explicit "Optional." for keyword arguments. Right? :)
There was a problem hiding this comment.
hmm, not sure if it's a good practice - but there can certainly be "required" keyword only params (hopefully not in our libraries, but still possible) - thought no harm in mentioning it's optional :)
There was a problem hiding this comment.
Given we already pass **kwargs into cls, why we need id=event.pop("id", None), etc.?
There was a problem hiding this comment.
hmm, intentionally popping them since we want to have the remainder of the dict as "extensions"
sdk/core/azure-core/tests/_mocks.py
Outdated
There was a problem hiding this comment.
Please give the file a more specific name.
|
And you also need to bump the core dependency version to 1.12.0 for event grid. :) |
8f08e33 to
4505a22
Compare
|
Please review core related chages here |
|
/azp run python - autorest - pr |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Fixes #16585
Adding
CloudEventto azure-core as follows: