Skip to content

Commit a4187e0

Browse files
jackye1995claude
andauthored
fix(rest): make data_type optional in AlterColumnsEntry (#338)
## Summary Remove `data_type` from `required` in `AlterColumnsEntry`. UDF-only alterations only need `path` + `virtual_column` — forcing `data_type` causes clients to send empty/redundant values that can trigger server-side metadata issues. ## Test plan - [x] YAML validates - [x] All clients build Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5643f9b commit a4187e0

14 files changed

Lines changed: 24 additions & 30 deletions

File tree

docs/src/client/operations/models/AlterColumnsEntry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
| Name | Type | Description | Notes |
99
|------------ | ------------- | ------------- | -------------|
1010
|**path** | **String** | Column path to alter | |
11-
|**dataType** | **Object** | New data type for the column using JSON representation (optional) | |
11+
|**dataType** | **Object** | New data type for the column using JSON representation (optional) | [optional] |
1212
|**rename** | **String** | New name for the column (optional) | [optional] |
1313
|**nullable** | **Boolean** | Whether the column should be nullable (optional) | [optional] |
1414
|**virtualColumn** | [**AlterVirtualColumnEntry**](AlterVirtualColumnEntry.md) | | [optional] |

docs/src/rest.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4680,7 +4680,6 @@ components:
46804680
type: object
46814681
required:
46824682
- path
4683-
- data_type
46844683
properties:
46854684
path:
46864685
type: string

java/lance-namespace-apache-client/api/openapi.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7265,7 +7265,6 @@ components:
72657265
virtual_column:
72667266
$ref: '#/components/schemas/AlterVirtualColumnEntry'
72677267
required:
7268-
- data_type
72697268
- path
72707269
AlterVirtualColumnEntry:
72717270
example:

java/lance-namespace-apache-client/docs/AlterColumnsEntry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
| Name | Type | Description | Notes |
99
|------------ | ------------- | ------------- | -------------|
1010
|**path** | **String** | Column path to alter | |
11-
|**dataType** | **Object** | New data type for the column using JSON representation (optional) | |
11+
|**dataType** | **Object** | New data type for the column using JSON representation (optional) | [optional] |
1212
|**rename** | **String** | New name for the column (optional) | [optional] |
1313
|**nullable** | **Boolean** | Whether the column should be nullable (optional) | [optional] |
1414
|**virtualColumn** | [**AlterVirtualColumnEntry**](AlterVirtualColumnEntry.md) | | [optional] |

java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/AlterColumnsEntry.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class AlterColumnsEntry {
4141
@javax.annotation.Nonnull private String path;
4242

4343
public static final String JSON_PROPERTY_DATA_TYPE = "data_type";
44-
@javax.annotation.Nonnull private Object dataType;
44+
@javax.annotation.Nullable private Object dataType;
4545

4646
public static final String JSON_PROPERTY_RENAME = "rename";
4747
@javax.annotation.Nullable private JsonNullable<String> rename = JsonNullable.<String>undefined();
@@ -83,7 +83,7 @@ public void setPath(@javax.annotation.Nonnull String path) {
8383
this.path = path;
8484
}
8585

86-
public AlterColumnsEntry dataType(@javax.annotation.Nonnull Object dataType) {
86+
public AlterColumnsEntry dataType(@javax.annotation.Nullable Object dataType) {
8787

8888
this.dataType = dataType;
8989
return this;
@@ -94,16 +94,16 @@ public AlterColumnsEntry dataType(@javax.annotation.Nonnull Object dataType) {
9494
*
9595
* @return dataType
9696
*/
97-
@javax.annotation.Nonnull
97+
@javax.annotation.Nullable
9898
@JsonProperty(JSON_PROPERTY_DATA_TYPE)
99-
@JsonInclude(value = JsonInclude.Include.ALWAYS)
99+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
100100
public Object getDataType() {
101101
return dataType;
102102
}
103103

104104
@JsonProperty(JSON_PROPERTY_DATA_TYPE)
105-
@JsonInclude(value = JsonInclude.Include.ALWAYS)
106-
public void setDataType(@javax.annotation.Nonnull Object dataType) {
105+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
106+
public void setDataType(@javax.annotation.Nullable Object dataType) {
107107
this.dataType = dataType;
108108
}
109109

java/lance-namespace-async-client/api/openapi.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7265,7 +7265,6 @@ components:
72657265
virtual_column:
72667266
$ref: '#/components/schemas/AlterVirtualColumnEntry'
72677267
required:
7268-
- data_type
72697268
- path
72707269
AlterVirtualColumnEntry:
72717270
example:

java/lance-namespace-async-client/docs/AlterColumnsEntry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
| Name | Type | Description | Notes |
99
|------------ | ------------- | ------------- | -------------|
1010
|**path** | **String** | Column path to alter | |
11-
|**dataType** | **Object** | New data type for the column using JSON representation (optional) | |
11+
|**dataType** | **Object** | New data type for the column using JSON representation (optional) | [optional] |
1212
|**rename** | **String** | New name for the column (optional) | [optional] |
1313
|**nullable** | **Boolean** | Whether the column should be nullable (optional) | [optional] |
1414
|**virtualColumn** | [**AlterVirtualColumnEntry**](AlterVirtualColumnEntry.md) | | [optional] |

java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterColumnsEntry.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class AlterColumnsEntry {
4141
@javax.annotation.Nonnull private String path;
4242

4343
public static final String JSON_PROPERTY_DATA_TYPE = "data_type";
44-
@javax.annotation.Nonnull private Object dataType;
44+
@javax.annotation.Nullable private Object dataType;
4545

4646
public static final String JSON_PROPERTY_RENAME = "rename";
4747
private JsonNullable<String> rename = JsonNullable.<String>undefined();
@@ -78,7 +78,7 @@ public void setPath(@javax.annotation.Nonnull String path) {
7878
this.path = path;
7979
}
8080

81-
public AlterColumnsEntry dataType(@javax.annotation.Nonnull Object dataType) {
81+
public AlterColumnsEntry dataType(@javax.annotation.Nullable Object dataType) {
8282
this.dataType = dataType;
8383
return this;
8484
}
@@ -88,16 +88,16 @@ public AlterColumnsEntry dataType(@javax.annotation.Nonnull Object dataType) {
8888
*
8989
* @return dataType
9090
*/
91-
@javax.annotation.Nonnull
91+
@javax.annotation.Nullable
9292
@JsonProperty(JSON_PROPERTY_DATA_TYPE)
93-
@JsonInclude(value = JsonInclude.Include.ALWAYS)
93+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
9494
public Object getDataType() {
9595
return dataType;
9696
}
9797

9898
@JsonProperty(JSON_PROPERTY_DATA_TYPE)
99-
@JsonInclude(value = JsonInclude.Include.ALWAYS)
100-
public void setDataType(@javax.annotation.Nonnull Object dataType) {
99+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
100+
public void setDataType(@javax.annotation.Nullable Object dataType) {
101101
this.dataType = dataType;
102102
}
103103

java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/AlterColumnsEntry.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ public AlterColumnsEntry() {
4343
}
4444

4545
/** Constructor with only required parameters */
46-
public AlterColumnsEntry(String path, Object dataType) {
46+
public AlterColumnsEntry(String path) {
4747
this.path = path;
48-
this.dataType = dataType;
4948
}
5049

5150
public AlterColumnsEntry path(String path) {
@@ -82,11 +81,10 @@ public AlterColumnsEntry dataType(Object dataType) {
8281
*
8382
* @return dataType
8483
*/
85-
@NotNull
8684
@Schema(
8785
name = "data_type",
8886
description = "New data type for the column using JSON representation (optional)",
89-
requiredMode = Schema.RequiredMode.REQUIRED)
87+
requiredMode = Schema.RequiredMode.NOT_REQUIRED)
9088
@JsonProperty("data_type")
9189
public Object getDataType() {
9290
return dataType;

python/lance_namespace_urllib3_client/docs/AlterColumnsEntry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
88
**path** | **str** | Column path to alter |
9-
**data_type** | **object** | New data type for the column using JSON representation (optional) |
9+
**data_type** | **object** | New data type for the column using JSON representation (optional) | [optional]
1010
**rename** | **str** | New name for the column (optional) | [optional]
1111
**nullable** | **bool** | Whether the column should be nullable (optional) | [optional]
1212
**virtual_column** | [**AlterVirtualColumnEntry**](AlterVirtualColumnEntry.md) | | [optional]

0 commit comments

Comments
 (0)