Skip to content

Conversation

@kuldeepgudekar
Copy link

@kuldeepgudekar kuldeepgudekar commented May 28, 2025

Includes change for the new API enpoint export_page and test case around it. The report download test case is unavailable due to the following reasons:

  1. The Report entity is not public, meaning we do not have access to this entity via the Python API. It is merely a table for storing data.
  2. Since we cannot access the Report entity, we are unable to create the report entry for the page being tested in the test case.
  3. Additionally, mocking the remote call is not feasible because the export_page function internally checks if a report is available.

@kuldeepgudekar
Copy link
Author

Test cases dependes on changes made in
https://git.autodesk.com/shotgun/shotgun/pull/17891

Copy link
Contributor

@carlos-villavicencio-adsk carlos-villavicencio-adsk left a comment

Choose a reason for hiding this comment

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

Let's add some documentation in the /docs directory. This will end up in the docs site.

@carlos-villavicencio-adsk carlos-villavicencio-adsk changed the title Ticket/sg 35561 export csv python changes SG-35561 export csv python changes Jun 11, 2025
@carlos-villavicencio-adsk
Copy link
Contributor

Hello @kuldeepgudekar , please merge the master branch into your PR. That's because we recently pushed some updates.

self.assertIn("'page_id' missing", str(cm.exception))

@unittest.mock.patch("shotgun_api3.shotgun.Http.request")
def test_export_page_without_layout_name(self, mock_request):
Copy link
Author

@kuldeepgudekar kuldeepgudekar Sep 16, 2025

Choose a reason for hiding this comment

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

We have not exposed the ExportPage entity so that we can't create it from self.sg, we can only query it. We can create it from FPTR ui calls.

Copy link
Contributor

@carlos-villavicencio-adsk carlos-villavicencio-adsk left a comment

Choose a reason for hiding this comment

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

LGTM.

Before moving forward, I have two requests:

  1. Please add some documentation to the docs directory. This will be automatically be rendered at the help site here: https://developers.shotgridsoftware.com/python-api/

  2. If you plan to release this ASAP, you can include some of the release pre-requisites like the ones on this PR. Otherwise, you can open a new PR, but please note that this should be done before releasing a new version.

@kuldeepgudekar
Copy link
Author

LGTM.

Before moving forward, I have two requests:

  1. Please add some documentation to the docs directory. This will be automatically be rendered at the help site here: https://developers.shotgridsoftware.com/python-api/
  2. If you plan to release this ASAP, you can include some of the release pre-requisites like the ones on this PR. Otherwise, you can open a new PR, but please note that this should be done before releasing a new version.

Thanks @carlos-villavicencio-adsk , I have updated it with required changes.

Copy link
Contributor

@carlos-villavicencio-adsk carlos-villavicencio-adsk left a comment

Choose a reason for hiding this comment

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

LGTM. Let's wait more approvals from the team

julien-lang
julien-lang previously approved these changes Sep 17, 2025
HISTORY.rst Outdated
Comment on lines 10 to 11
- Add ``export_page`` method to Shotgun class.
- Update in documentation.
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add a clearer and more customer-friendly message for the release notes, please.

Copy link
Contributor

@mchesnay mchesnay left a comment

Choose a reason for hiding this comment

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

Added a couple of comments for docstrings.

"""
Export the specified page to the given format.
This method allows you to export a page to CSV.
Respective layout or page should be marked as API Exportable in the Shotgun.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Respective layout or page should be marked as API Exportable in the Shotgun.
Respective layout or page should be marked as API Exportable in the Flow Production Tracking UI.

"ID,Name,Status\\n1,Shot 001,ip\\n2,Shot 002,rev\\n"
:param int page_id: The ID of the page to export.
:param str format: The format to export the page to. Supported format is ``"csv"``.
:param str layout_name: optional layout name. This should be the name of the layout seen in the Shotgun UI.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
:param str layout_name: optional layout name. This should be the name of the layout seen in the Shotgun UI.
:param str layout_name: Optional layout name. This should be the name of the layout seen in the Flow Production Tracking UI.

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