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

Add -Fields parameter to Get-GSDriveFileList #177

Closed
WJurecki opened this issue Apr 7, 2019 · 6 comments
Closed

Add -Fields parameter to Get-GSDriveFileList #177

WJurecki opened this issue Apr 7, 2019 · 6 comments
Assignees

Comments

@WJurecki
Copy link
Contributor

WJurecki commented Apr 7, 2019

I would like to be able to specify what fields to have returned to increate performance.

For example I know that in my code I am only ever going to use the parents, name, id, and folderColorRgb properties of the objects returned and therefore would like to increase performance by not having the remaining properties collected and returned.

I would like a -Fields parameter added that accepts property names.

Such as: Get-GSDriveFileList -Fields 'parents,name,id,folderColorRgb' or Get-GSDriveFileList -Fields 'parents','name','id','folderColorRgb'

This example would result in the value assigned to $request.Fields at line 116 being files(parents,name,id,folderColorRgb),kind,nextPageToken

API Explorer confirms this is the proper format for the $request.Fields

For compatibility with existing behavior you could simply have this new -Fields parameter default to * since files(*),kind,nextPageToken is a valid request that returns the current result set.

Performance Tips discusses this and shows proper formatting.

@scrthq
Copy link
Member

scrthq commented Apr 7, 2019

hey @WJurecki - This was actually brought up in an issue a while ago, and it appears that the difference between the .NET SDK when leaving the default value for Fields (or even wide open as *) on a request vs specifying a subset of Fields is negligible: #63 (comment)

I'm adding it in, but forewarning that it doesn't add a performance gain as you'd expect. Here is my testing after adding, you can see that getting a subset of fields performs roughly the same as getting all of them.

image

Note that the previous setup was defaulting to 'files,kind,nextPageToken', so I've retained that as the default value for the parameter.

scrthq added a commit that referenced this issue Apr 25, 2019
## 2.26.2

* [Issue #177](#177)
  * Added: Fields parameter to Get-GSDriveFileList
* [Issue #178](#178)
  * Fixed: Start-GSDriveFileUpload failing on PowerShell 4.0
* [Issue #179](#179)
  * Added: Ims parameter to both New-GSUser and Update-GSUser
  * Added: Add-GSUserIm function to create correct type for new Ims parameter.
* Miscellaneous
  * Added: Clear-PSGSuiteServiceCache to clear the cache and dispose of any remaining open web clients.
  * Improved overall service caching.
  * Added: Support for Cloud-Identity licenses for Get-GSUserLicense
  * Added: OutputType for all applicable Helper functions (i.e. Add-GSUserIm)
scrthq added a commit that referenced this issue Apr 25, 2019
## 2.26.2

* [Issue #177](#177)
  * Added: `Fields` parameter to `Get-GSDriveFileList`
* [Issue #178](#178)
  * Fixed: `Start-GSDriveFileUpload` failing on PowerShell 4.0
* [Issue #179](#179)
  * Added: `Ims` parameter to both `New-GSUser` and `Update-GSUser`
  * Added: `Add-GSUserIm` function to create correct type for new `Ims` parameter.
* Miscellaneous
  * Added: `Clear-PSGSuiteServiceCache` to clear the cache and dispose of any remaining open web clients.
  * Improved overall service caching.
  * Added: Support for `Cloud-Identity` licenses for `Get-GSUserLicense`
  * Added: `OutputType` for all applicable Helper functions (i.e. `Add-GSUserIm`)
scrthq added a commit that referenced this issue Apr 25, 2019
## 2.26.2

* [Issue #177](#177)
  * Added: Fields parameter to Get-GSDriveFileList
* [Issue #178](#178)
  * Fixed: Start-GSDriveFileUpload failing on PowerShell 4.0
* [Issue #179](#179)
  * Added: Ims parameter to both New-GSUser and Update-GSUser
  * Added: Add-GSUserIm function to create correct type for new Ims parameter.
* Miscellaneous
  * Added: Clear-PSGSuiteServiceCache to clear the cache and dispose of any remaining open web clients.
  * Improved overall service caching.
  * Added: Support for Cloud-Identity licenses for Get-GSUserLicense
  * Added: OutputType for all applicable Helper functions (i.e. Add-GSUserIm)
@scrthq
Copy link
Member

scrthq commented Apr 25, 2019

Hey @WJurecki - v2.26.2 is out now with Fields support for Get-GSDriveFileList. Please try it out and let me know if you're having any issues! Thanks for your patience!

@scrthq scrthq self-assigned this Apr 25, 2019
@scrthq scrthq closed this as completed Apr 25, 2019
@WJurecki
Copy link
Contributor Author

Hi @scrthq, thanks for adding the -Fields option.

It appears these is an issue with a logic of this new feature.

When executing Get-GSDriveFileList without the -Fields option the returned objects are different in version 2.26.2 than it was in 2.26.1. This is because $request.Fields is only set when -Fields is specified and therefore never being set with the default of 'files,kind,nextPageToken' and results in the google default field set.

This further shows that the issue with Get-GSDriveFileList limits pagesize to 100 #175 must be a vendor limit of the returned result size because when specifying only a few fields pagesize works up to 1,000.

@scrthq
Copy link
Member

scrthq commented Apr 26, 2019

Good catch @WJurecki ! See my note here on that PR where that code bit changed. Very accurate analysis.

Checking out the difference in behavior now and will get it resolved asap if impacting!

@scrthq
Copy link
Member

scrthq commented Apr 26, 2019

Confirmed the difference, getting a fix out in a few minutes 💪 thanks again!

scrthq added a commit that referenced this issue Apr 26, 2019
## 2.26.4

* [Issue #177](#177) - _Thanks, [@WJurecki](https://github.com/WJurecki)!_
  * Fixed: Fields parameter Get-GSDriveFileList would not set correctly with the default fields value, breaking the expected experience. Restored the same functionality
@scrthq
Copy link
Member

scrthq commented Apr 26, 2019

Fixed and deployed in v2.26.4!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants