Skip to content
Snippets Groups Projects
Commit 271bec42 authored by Martin Weise's avatar Martin Weise
Browse files

Merge branch 'hotfix/analysis' into 'dev'

Hotfixed the decimal values

See merge request !340
parents 038d89c6 ad136f78
No related branches found
No related tags found
6 merge requests!356Dev,!350Dev,!347Resolve "Bug prevents volume computation when data length column in Metadata DB is null",!345Updated docs and endpoints:,!341Fixed mapping problem where UK and FK share columns they are inserted,!340Hotfixed the decimal values
...@@ -44,7 +44,6 @@ class ColumnAnalysisDto(BaseModel): ...@@ -44,7 +44,6 @@ class ColumnAnalysisDto(BaseModel):
null_allowed: bool null_allowed: bool
size: Optional[int] = None size: Optional[int] = None
d: Optional[int] = None d: Optional[int] = None
dfid: Optional[int] = None
enums: Optional[list] = None enums: Optional[list] = None
sets: Optional[list] = None sets: Optional[list] = None
......
...@@ -74,6 +74,8 @@ def determine_datatypes(filename, enum=False, enum_tol=0.0001, separator=',') -> ...@@ -74,6 +74,8 @@ def determine_datatypes(filename, enum=False, enum_tol=0.0001, separator=',') ->
if pandas.to_numeric(df[name], errors='coerce').notnull().all(): if pandas.to_numeric(df[name], errors='coerce').notnull().all():
logging.debug(f"mapped column {name} from float64 to decimal") logging.debug(f"mapped column {name} from float64 to decimal")
col.type = DataTypeDto.DECIMAL col.type = DataTypeDto.DECIMAL
col.size = 40
col.d = 20
else: else:
logging.debug(f"mapped column {name} from float64 to text") logging.debug(f"mapped column {name} from float64 to text")
col.type = DataTypeDto.TEXT col.type = DataTypeDto.TEXT
......
...@@ -36,6 +36,8 @@ class DetermineDatatypesTest(unittest.TestCase): ...@@ -36,6 +36,8 @@ class DetermineDatatypesTest(unittest.TestCase):
}, },
"Wert": { "Wert": {
"type": "decimal", "type": "decimal",
"size": 40,
"d": 20,
"null_allowed": False, "null_allowed": False,
}, },
"Status": { "Status": {
...@@ -81,6 +83,8 @@ class DetermineDatatypesTest(unittest.TestCase): ...@@ -81,6 +83,8 @@ class DetermineDatatypesTest(unittest.TestCase):
}, },
"Wert": { "Wert": {
"type": "decimal", "type": "decimal",
"size": 40,
"d": 20,
"null_allowed": False, "null_allowed": False,
}, },
"Status": { "Status": {
...@@ -125,6 +129,8 @@ class DetermineDatatypesTest(unittest.TestCase): ...@@ -125,6 +129,8 @@ class DetermineDatatypesTest(unittest.TestCase):
}, },
"Wert": { "Wert": {
"type": "decimal", "type": "decimal",
"size": 40,
"d": 20,
"null_allowed": False, "null_allowed": False,
}, },
"Status": { "Status": {
...@@ -149,6 +155,8 @@ class DetermineDatatypesTest(unittest.TestCase): ...@@ -149,6 +155,8 @@ class DetermineDatatypesTest(unittest.TestCase):
}, },
"float": { "float": {
"type": "decimal", "type": "decimal",
"size": 40,
"d": 20,
"null_allowed": False, "null_allowed": False,
}, },
"string": { "string": {
......
No preview for this file type
...@@ -4,6 +4,16 @@ ...@@ -4,6 +4,16 @@
ref="form" ref="form"
v-model="valid" v-model="valid"
:disabled="disabled"> :disabled="disabled">
<v-row
v-if="showPrimaryKeyWarning">
<v-col md="8">
<v-alert
border="start"
color="warning">
{{ $t('pages.table.subpages.import.schema.primary.warn') }}
</v-alert>
</v-col>
</v-row>
<v-row <v-row
v-for="(c, idx) in columns" v-for="(c, idx) in columns"
:key="`r-${idx}`" :key="`r-${idx}`"
...@@ -79,7 +89,6 @@ ...@@ -79,7 +89,6 @@
:min="columnType(c).size_min" :min="columnType(c).size_min"
:max="columnType(c).size_max" :max="columnType(c).size_max"
:step="columnType(c).size_step" :step="columnType(c).size_step"
:value="columnType(c).size_required === true ? columnType(c).size_default : null"
:hint="sizeHint(c)" :hint="sizeHint(c)"
:clearable="!columnType(c).size_required" :clearable="!columnType(c).size_required"
persistent-hint persistent-hint
...@@ -163,16 +172,6 @@ ...@@ -163,16 +172,6 @@
@click="addColumn()" /> @click="addColumn()" />
</v-col> </v-col>
</v-row> </v-row>
<v-row
v-if="showPrimaryKeyWarning">
<v-col md="8">
<v-alert
border="start"
color="warning">
{{ $t('pages.table.subpages.import.schema.primary.warn') }}
</v-alert>
</v-col>
</v-row>
<v-row> <v-row>
<v-col> <v-col>
<v-btn <v-btn
...@@ -300,7 +299,7 @@ export default { ...@@ -300,7 +299,7 @@ export default {
this.columns.splice(idx, 1) this.columns.splice(idx, 1)
}, },
addColumn (name = '', type = null, null_allowed = true, primary_key = false, unique = false) { addColumn (name = '', type = null, null_allowed = true, primary_key = false, unique = false) {
this.columns.push({ const column = {
name, name,
type, type,
null_allowed, null_allowed,
...@@ -309,9 +308,10 @@ export default { ...@@ -309,9 +308,10 @@ export default {
sets_values: null, sets_values: null,
enums: [], enums: [],
enums_values: null, enums_values: null,
size: 0,
d: 0 d: 0
}) }
column.size = this.columnType(column).size_required === true ? this.columnType(column).size_default : null
this.columns.push()
this.$refs.form.validate() this.$refs.form.validate()
}, },
formatValues (column) { formatValues (column) {
......
...@@ -370,7 +370,7 @@ ...@@ -370,7 +370,7 @@
"hint": "Required. First line contains only data" "hint": "Required. First line contains only data"
}, },
"storage": { "storage": {
"text": "Dataset from Storage Service" "text": "Uploaded Dataset"
}, },
"quote": { "quote": {
"label": "Quote Encoding", "label": "Quote Encoding",
......
import {transformAssetUrls} from 'vite-plugin-vuetify' import {transformAssetUrls} from 'vite-plugin-vuetify'
import vuetify from 'vite-plugin-vuetify'
const proxy: any = {} const proxy: any = {}
...@@ -117,7 +118,12 @@ export default defineNuxtConfig({ ...@@ -117,7 +118,12 @@ export default defineNuxtConfig({
'@artmizu/nuxt-prometheus', '@artmizu/nuxt-prometheus',
'@nuxtjs/i18n', '@nuxtjs/i18n',
'@pinia/nuxt', '@pinia/nuxt',
'@pinia-plugin-persistedstate/nuxt' '@pinia-plugin-persistedstate/nuxt',
async (options, nuxt) => {
nuxt.hooks.hook('vite:extendConfig', config => config.plugins.push(
vuetify()
))
},
], ],
pinia: { pinia: {
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
"@pinia-plugin-persistedstate/nuxt": "^1.2.0", "@pinia-plugin-persistedstate/nuxt": "^1.2.0",
"@types/qs": "^6.9.12", "@types/qs": "^6.9.12",
"sass": "^1.71.0", "sass": "^1.71.0",
"vite-plugin-vuetify": "^2.0.1" "vite-plugin-vuetify": "^2.0.4"
}, },
"browserslist": [ "browserslist": [
"defaults and fully supports es6-module", "defaults and fully supports es6-module",
......
...@@ -137,18 +137,12 @@ export default { ...@@ -137,18 +137,12 @@ export default {
}) })
.catch(({code}) => { .catch(({code}) => {
const toast = useToastInstance() const toast = useToastInstance()
if (typeof code !== 'string') {
return
}
toast.error(this.$t(code)) toast.error(this.$t(code))
}) })
}) })
.catch(({code}) => { .catch(({code}) => {
this.loading = false this.loading = false
const toast = useToastInstance() const toast = useToastInstance()
if (typeof code !== 'string') {
return
}
toast.error(this.$t(code)) toast.error(this.$t(code))
}) })
.finally(() => { .finally(() => {
......
// plugins/vuetify.js // plugins/vuetify.js
import { createVuetify, type ThemeDefinition } from 'vuetify' import { createVuetify, type ThemeDefinition } from 'vuetify'
import colors from 'vuetify/util/colors' import colors from 'vuetify/util/colors'
import * as components from 'vuetify/components'
import * as directives from 'vuetify/directives' import * as directives from 'vuetify/directives'
import '@mdi/font/css/materialdesignicons.css' import '@mdi/font/css/materialdesignicons.css'
import {rgbParse} from "@kurkle/color";
const tuwThemeLight: ThemeDefinition = { const tuwThemeLight: ThemeDefinition = {
dark: false, dark: false,
...@@ -77,7 +75,6 @@ const tuwThemeDarkContrast: ThemeDefinition = { ...@@ -77,7 +75,6 @@ const tuwThemeDarkContrast: ThemeDefinition = {
export default defineNuxtPlugin(app => { export default defineNuxtPlugin(app => {
const vuetify : any = createVuetify({ const vuetify : any = createVuetify({
ssr: true, ssr: true,
components,
directives, directives,
defaults: { defaults: {
VSelect: { VSelect: {
......
...@@ -1056,17 +1056,9 @@ export function axiosErrorToApiError(error: AxiosError): ApiErrorDto { ...@@ -1056,17 +1056,9 @@ export function axiosErrorToApiError(error: AxiosError): ApiErrorDto {
message: error.message message: error.message
} }
return errorObj return errorObj
} else if (error.code === 'ERR_BAD_REQUEST') {
/* timeout */
const errorObj: ApiErrorDto = {
status: error.code,
code: 'error.axios.malformed',
message: error.message
}
return errorObj
} }
if (error.response?.data) { if ('data' in error.response) {
const errorObj: ApiErrorDto = (error.response?.data as ApiErrorDto) const errorObj: ApiErrorDto = (error.response.data as ApiErrorDto)
return errorObj return errorObj
} }
const errorObj: ApiErrorDto = { const errorObj: ApiErrorDto = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment