Skip to content

Commit

Permalink
fix(openapi): adds in previously ignored keep alive value (#12068)
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanHolstien authored Dec 10, 2024
1 parent bcf230f commit a290b24
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/how/updating-datahub.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ This file documents any backwards-incompatible changes in DataHub and assists pe
- #11742: For PowerBi ingestion, `use_powerbi_email` is now enabled by default when extracting ownership information.
- #12056: The DataHub Airflow plugin no longer supports Airflow 2.1 and Airflow 2.2.
- #12056: The DataHub Airflow plugin now defaults to the v2 plugin implementation.
- OpenAPI Update: PIT Keep Alive parameter added to scroll. NOTE: This parameter requires the `pointInTimeCreationEnabled` feature flag to be enabled and the `elasticSearch.implementation` configuration to be `elasticsearch`. This feature is not supported for OpenSearch at this time and the parameter will not be respected without both of these set.

### Breaking Changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@ public ResponseEntity<S> getEntities(
@RequestParam(value = "skipCache", required = false, defaultValue = "false")
Boolean skipCache,
@RequestParam(value = "includeSoftDelete", required = false, defaultValue = "false")
Boolean includeSoftDelete)
Boolean includeSoftDelete,
@RequestParam(value = "pitKeepAlive", required = false, defaultValue = "5m")
String pitKeepALive)
throws URISyntaxException {

EntitySpec entitySpec = entityRegistry.getEntitySpec(entityName);
Expand Down Expand Up @@ -241,7 +243,7 @@ public ResponseEntity<S> getEntities(
null,
sortCriteria,
scrollId,
null,
pitKeepALive,
count);

if (!AuthUtil.isAPIAuthorizedResult(opContext, result)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class OpenAPIV3Generator {
private static final String NAME_VERSION = "version";
private static final String NAME_SCROLL_ID = "scrollId";
private static final String NAME_INCLUDE_SOFT_DELETE = "includeSoftDelete";
private static final String NAME_PIT_KEEP_ALIVE = "pitKeepAlive";
private static final String PROPERTY_VALUE = "value";
private static final String PROPERTY_URN = "urn";
private static final String PROPERTY_PATCH = "patch";
Expand Down Expand Up @@ -502,6 +503,12 @@ private static PathItem buildGenericListEntitiesPath() {
.name(NAME_SKIP_CACHE)
.description("Skip cache when listing entities.")
.schema(new Schema().type(TYPE_BOOLEAN)._default(false)),
new Parameter()
.in(NAME_QUERY)
.name(NAME_PIT_KEEP_ALIVE)
.description(
"Point In Time keep alive, accepts a time based string like \"5m\" for five minutes.")
.schema(new Schema().type(TYPE_STRING)._default("5m")),
new Parameter().$ref("#/components/parameters/PaginationCount" + MODEL_VERSION),
new Parameter().$ref("#/components/parameters/ScrollId" + MODEL_VERSION),
new Parameter().$ref("#/components/parameters/SortBy" + MODEL_VERSION),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ public ResponseEntity<GenericEntityScrollResultV3> scrollEntities(
Boolean skipCache,
@RequestParam(value = "includeSoftDelete", required = false, defaultValue = "false")
Boolean includeSoftDelete,
@RequestParam(value = "pitKeepAlive", required = false, defaultValue = "5m")
String pitKeepALive,
@RequestBody @Nonnull GenericEntityAspectsBodyV3 entityAspectsBody)
throws URISyntaxException {

Expand Down Expand Up @@ -202,7 +204,7 @@ public ResponseEntity<GenericEntityScrollResultV3> scrollEntities(
null,
sortCriteria,
scrollId,
null,
pitKeepALive,
count);

if (!AuthUtil.isAPIAuthorizedResult(opContext, result)) {
Expand Down

0 comments on commit a290b24

Please sign in to comment.