Skip to content

Conversation

@palisir
Copy link
Contributor

@palisir palisir commented Jul 30, 2019

The goal of SG-12945 is to expose a new param "localised" on the object Shotgun, to give the ability to get localized fields when possible (only DisplayColumn at the time).
Documentation is on its way too.

As discussed with @thebeeland, the requirement for tests will be evaluated by the reviewer.

@palisir palisir requested a review from thebeeland July 30, 2019 19:58
@palisir palisir self-assigned this Jul 30, 2019
Copy link
Contributor

@thebeeland thebeeland left a comment

Choose a reason for hiding this comment

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

If I'm correct about defaulting localized to true, in that it'll potentially break existing code using this API, then I'd like to see that change to a default of false to maintain the default behavior we have right now going forward. If that doesn't make sense, feel free to reach out.

session_token=None,
auth_token=None):
auth_token=None,
localized=True):
Copy link
Contributor

Choose a reason for hiding this comment

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

I might default this to False. My fear would be that this will change the form of the data returned by the API and might break existing client scripts (or even stuff in Toolkit that we provide) without additional code changes to compensate for it.

@thebeeland
Copy link
Contributor

@palisir -- for testing, would it be possible to use a similar approach to the below to test that the new init argument triggers the header value to be added to the request if it's True, and that it doesn't when it's False?

https://github.com/shotgunsoftware/python-api/blob/master/tests/test_client.py#L167-L231

@manneohrstrom
Copy link
Contributor

Is is necessary to pass this in as part of the constructor? In other advanced cases like this (e.g. sg.config.rpc_attempt_interval = 1000), we don't always provide a ctor parameter - the __init__ is bloated as it is already.

In fact, there was a similar discussion recently - see #196 - where we ended up adding it to the config object only.

Copy link
Contributor

@manneohrstrom manneohrstrom left a comment

Choose a reason for hiding this comment

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

Hey there!

I think there are some things that need to be looked at before this can be merged:

  • I am seeing a lot of unrelated changes in this diff - do you need to merge in master? Alternatively, if these changes are indeed intended to be included in the PR, please update the PR description with more information about them!
  • I am not seeing any documentation - please take a look and add docs! If you could include a build of the updated docs look like, that would be great. That's how we normally review these things.

Ping me when you need another round of review and i'll be happy to help!


Here you can see the full list of changes between each Python API release.

v3.1.1 (2019 August 29)
Copy link
Contributor

Choose a reason for hiding this comment

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

How does this relate to this particular pull request? I am seeing a bunch of changes in the diff here that seem unrelated to this PR. Do you need to merge with master?

``auth_token`` is invalid.
.. todo: Add this info to the Authentication section of the docs
:param bool localized: A boolean to asks for some fields to be localized. When ``True``, a
Copy link
Contributor

Choose a reason for hiding this comment

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

This does not match the parameters of the constructor.

self.session_token = None
self.authorization = None
self.no_ssl_validation = False
self.localized = False
Copy link
Contributor

Choose a reason for hiding this comment

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

i am not seeing any docs or comments to describe what this is. Please add at least a comment - ideally sphinx docs in context of the code, but it's also ok if these are separate and part of the rst file.

@palisir
Copy link
Contributor Author

palisir commented Sep 5, 2019

As discussed with @manneohrstrom I am closing this PR to make a new one on another branch

@palisir palisir closed this Sep 5, 2019
@palisir palisir deleted the ticket/SG-12945_add_localized_param branch September 5, 2019 17:44
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.

6 participants