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

Remove data_type from column proto #1468

Merged
merged 1 commit into from Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion internal/codegen/python/gen.go
Expand Up @@ -187,6 +187,7 @@ func makePyType(req *plugin.CodeGenRequest, col *plugin.Column) pyType {
}

func pyInnerType(req *plugin.CodeGenRequest, col *plugin.Column) string {
columnType := sdk.DataType(col.Type)
for _, oride := range req.Settings.Overrides {
if !pyTypeIsSet(oride.PythonType) {
continue
Expand All @@ -195,7 +196,7 @@ func pyInnerType(req *plugin.CodeGenRequest, col *plugin.Column) string {
if oride.Column != "" && sdk.MatchString(oride.ColumnName, col.Name) && sameTable {
return pyTypeString(oride.PythonType)
}
if oride.DbType != "" && oride.DbType == col.DataType && oride.Nullable != (col.NotNull || col.IsArray) {
if oride.DbType != "" && oride.DbType == columnType && oride.Nullable != (col.NotNull || col.IsArray) {
return pyTypeString(oride.PythonType)
}
}
Expand Down
89 changes: 40 additions & 49 deletions internal/plugin/codegen.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 0 additions & 43 deletions internal/plugin/codegen_vtproto.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion protos/plugin/codegen.proto
Expand Up @@ -158,7 +158,6 @@ message Column
Identifier table = 10;
string table_alias = 11;
Identifier type = 12;
string data_type = 13;
}

message Query
Expand Down