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

Fix SCIM pagination #193

Merged
merged 4 commits into from
Nov 29, 2023
Merged

Fix SCIM pagination #193

merged 4 commits into from
Nov 29, 2023

Conversation

mgyucht
Copy link
Contributor

@mgyucht mgyucht commented Nov 24, 2023

Changes

Supersedes #188.

This PR incorporates two hard-coded changes for the SCIM API in the Python SDK:

startIndex starts at 1 for SCIM APIs, not 0. However, the existing .Pagination.Increment controls both the start index as well as whether the pagination is per-page or per-resource. Later, we should replace this extension with two independent OpenAPI options: one_indexed (defaulting to false) and pagination_basis (defaulting to resource but can be overridden to page).
If users don't specify a limit, the SDK will include a hard-coded limit of 100 resources per request. We could add this to the OpenAPI spec as an option default_limit, which is useful for any non-paginated APIs that later expose pagination options and allow the SDK to gracefully support those. However, we don't want to encourage folks to use this pattern: all new list APIs are required to be paginated from the start.

Tests

@mgyucht mgyucht changed the title Fix/java SCIM pagination Fix SCIM pagination Nov 24, 2023
@mgyucht mgyucht requested a review from tanmay-db November 24, 2023 14:44
0
{{- end}}L);{{end -}}
{{if and .Pagination.Limit (contains .Path "/scim/v2/")}}
if (request.get{{.Pagination.Limit.PascalName}}() == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: 0L instead of 0. It doesn't matter because implicitly java will know 0 is of Long type. But mentioning since we specify 1L and 100L below so might be good for consistency on code reading purposes.

@mgyucht mgyucht enabled auto-merge November 29, 2023 10:04
@mgyucht mgyucht added this pull request to the merge queue Nov 29, 2023
Merged via the queue into main with commit 4bb8371 Nov 29, 2023
9 checks passed
@mgyucht mgyucht deleted the fix/java-scim-pagination branch November 29, 2023 10:08
mgyucht added a commit that referenced this pull request Nov 29, 2023
Bug fixes:

* Fix databricks CLI authentication on Windows ([#192](#192)).
* Fix SCIM pagination ([#193](#193)).

Other changes:

* Add more detailed error message on default credentials not found error ([#180](#180)).
* Support custom scopes and redirectUrl for U2M OAuth flow ([#190](#190)).

API Changes:

 * Removed `enableOptimization()` method for `workspaceClient.metastores()` service.
 * Added `pipelineId` field for `com.databricks.sdk.service.catalog.TableInfo`.
 * Added `enablePredictiveOptimization` field for `com.databricks.sdk.service.catalog.UpdateCatalog` and `com.databricks.sdk.service.catalog.UpdateSchema`.
 * Removed `com.databricks.sdk.service.catalog.UpdatePredictiveOptimization` and `com.databricks.sdk.service.catalog.UpdatePredictiveOptimizationResponse` class.
 * Added `description` field for `com.databricks.sdk.service.jobs.CreateJob` and `com.databricks.sdk.service.jobs.JobSettings`.
 * Added `listNetworkConnectivityConfigurations()` and `listPrivateEndpointRules()` methods for `accountClient.networkConnectivity()` service.
 * Added `com.databricks.sdk.service.settings.ListNccAzurePrivateEndpointRulesResponse`, `com.databricks.sdk.service.settings.ListNetworkConnectivityConfigurationsRequest`, `com.databricks.sdk.service.settings.ListNetworkConnectivityConfigurationsResponse`, and `com.databricks.sdk.service.settings.ListPrivateEndpointRulesRequest` classes.
 * Added `stringSharedAs` field for `com.databricks.sdk.service.sharing.SharedDataObject`.

OpenAPI SHA: 22f09783eb8a84d52026f856be3b2068f9498db3, Date: 2023-11-23

Dependency updates:

 * Bump API spec: 23 Nov 2023 ([#191](#191)).
@mgyucht mgyucht mentioned this pull request Nov 29, 2023
github-merge-queue bot pushed a commit that referenced this pull request Nov 29, 2023
Bug fixes:

* Fix databricks CLI authentication on Windows
([#192](#192)).
* Fix SCIM pagination
([#193](#193)).

Other changes:

* Add more detailed error message on default credentials not found error
([#180](#180)).
* Support custom scopes and redirectUrl for U2M OAuth flow
([#190](#190)).

API Changes:

* Removed `enableOptimization()` method for
`workspaceClient.metastores()` service.
* Added `pipelineId` field for
`com.databricks.sdk.service.catalog.TableInfo`.
* Added `enablePredictiveOptimization` field for
`com.databricks.sdk.service.catalog.UpdateCatalog` and
`com.databricks.sdk.service.catalog.UpdateSchema`.
* Removed
`com.databricks.sdk.service.catalog.UpdatePredictiveOptimization` and
`com.databricks.sdk.service.catalog.UpdatePredictiveOptimizationResponse`
class.
* Added `description` field for
`com.databricks.sdk.service.jobs.CreateJob` and
`com.databricks.sdk.service.jobs.JobSettings`.
* Added `listNetworkConnectivityConfigurations()` and
`listPrivateEndpointRules()` methods for
`accountClient.networkConnectivity()` service.
* Added
`com.databricks.sdk.service.settings.ListNccAzurePrivateEndpointRulesResponse`,
`com.databricks.sdk.service.settings.ListNetworkConnectivityConfigurationsRequest`,
`com.databricks.sdk.service.settings.ListNetworkConnectivityConfigurationsResponse`,
and
`com.databricks.sdk.service.settings.ListPrivateEndpointRulesRequest`
classes.
* Added `stringSharedAs` field for
`com.databricks.sdk.service.sharing.SharedDataObject`.

OpenAPI SHA: 22f09783eb8a84d52026f856be3b2068f9498db3, Date: 2023-11-23
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.

3 participants