[Tables] Add __repr__ and __str__ methods to models - #19302
Conversation
|
Hello Sean Kane (@seankane-msft)! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
|
|
||
| def __str__(self): | ||
| # type: () -> str | ||
| return u"enabled={}, days={}".format(self.enabled, self.days) |
There was a problem hiding this comment.
__str__ is not supposed to return unicode. Must be type str
There was a problem hiding this comment.
Not sure whether the same applied to __repr__ - would need to check the Py2.7 stdlib ref docs.
| # type: () -> str | ||
| return "version={}, enabled={}, include_apis={}, retention_policy={}".format( | ||
| self.version, self.enabled, self.include_apis, self.retention_policy | ||
| ) |
There was a problem hiding this comment.
I'm thinking maybe we just don't define __str__ for the time being. Formatting with an instance will default to using __repr__ in the meantime anyway.
There was a problem hiding this comment.
I went with this suggestion and removed __str__ methods for now, we can always add them back later.
|
/azp run python - tables - ci |
|
Azure Pipelines successfully started running 1 pipeline(s). |
closes #19278
Will help make debugging easier for us and customers