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):
null_allowed: bool
size: Optional[int] = None
d: Optional[int] = None
dfid: Optional[int] = None
enums: Optional[list] = None
sets: Optional[list] = None
......
......@@ -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():
logging.debug(f"mapped column {name} from float64 to decimal")
col.type = DataTypeDto.DECIMAL
col.size = 40
col.d = 20
else:
logging.debug(f"mapped column {name} from float64 to text")
col.type = DataTypeDto.TEXT
......
......@@ -36,6 +36,8 @@ class DetermineDatatypesTest(unittest.TestCase):
},
"Wert": {
"type": "decimal",
"size": 40,
"d": 20,
"null_allowed": False,
},
"Status": {
......@@ -81,6 +83,8 @@ class DetermineDatatypesTest(unittest.TestCase):
},
"Wert": {
"type": "decimal",
"size": 40,
"d": 20,
"null_allowed": False,
},
"Status": {
......@@ -125,6 +129,8 @@ class DetermineDatatypesTest(unittest.TestCase):
},
"Wert": {
"type": "decimal",
"size": 40,
"d": 20,
"null_allowed": False,
},
"Status": {
......@@ -149,6 +155,8 @@ class DetermineDatatypesTest(unittest.TestCase):
},
"float": {
"type": "decimal",
"size": 40,
"d": 20,
"null_allowed": False,
},
"string": {
......
No preview for this file type
......@@ -4,6 +4,16 @@
ref="form"
v-model="valid"
: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-for="(c, idx) in columns"
:key="`r-${idx}`"
......@@ -79,7 +89,6 @@
:min="columnType(c).size_min"
:max="columnType(c).size_max"
:step="columnType(c).size_step"
:value="columnType(c).size_required === true ? columnType(c).size_default : null"
:hint="sizeHint(c)"
:clearable="!columnType(c).size_required"
persistent-hint
......@@ -163,16 +172,6 @@
@click="addColumn()" />
</v-col>
</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-col>
<v-btn
......@@ -300,7 +299,7 @@ export default {
this.columns.splice(idx, 1)
},
addColumn (name = '', type = null, null_allowed = true, primary_key = false, unique = false) {
this.columns.push({
const column = {
name,
type,
null_allowed,
......@@ -309,9 +308,10 @@ export default {
sets_values: null,
enums: [],
enums_values: null,
size: 0,
d: 0
})
}
column.size = this.columnType(column).size_required === true ? this.columnType(column).size_default : null
this.columns.push()
this.$refs.form.validate()
},
formatValues (column) {
......
......@@ -370,7 +370,7 @@
"hint": "Required. First line contains only data"
},
"storage": {
"text": "Dataset from Storage Service"
"text": "Uploaded Dataset"
},
"quote": {
"label": "Quote Encoding",
......
import {transformAssetUrls} from 'vite-plugin-vuetify'
import vuetify from 'vite-plugin-vuetify'
const proxy: any = {}
......@@ -117,7 +118,12 @@ export default defineNuxtConfig({
'@artmizu/nuxt-prometheus',
'@nuxtjs/i18n',
'@pinia/nuxt',
'@pinia-plugin-persistedstate/nuxt'
'@pinia-plugin-persistedstate/nuxt',
async (options, nuxt) => {
nuxt.hooks.hook('vite:extendConfig', config => config.plugins.push(
vuetify()
))
},
],
pinia: {
......
......@@ -45,7 +45,7 @@
"@pinia-plugin-persistedstate/nuxt": "^1.2.0",
"@types/qs": "^6.9.12",
"sass": "^1.71.0",
"vite-plugin-vuetify": "^2.0.1"
"vite-plugin-vuetify": "^2.0.4"
},
"browserslist": [
"defaults and fully supports es6-module",
......
......@@ -137,18 +137,12 @@ export default {
})
.catch(({code}) => {
const toast = useToastInstance()
if (typeof code !== 'string') {
return
}
toast.error(this.$t(code))
})
})
.catch(({code}) => {
this.loading = false
const toast = useToastInstance()
if (typeof code !== 'string') {
return
}
toast.error(this.$t(code))
})
.finally(() => {
......
// plugins/vuetify.js
import { createVuetify, type ThemeDefinition } from 'vuetify'
import colors from 'vuetify/util/colors'
import * as components from 'vuetify/components'
import * as directives from 'vuetify/directives'
import '@mdi/font/css/materialdesignicons.css'
import {rgbParse} from "@kurkle/color";
const tuwThemeLight: ThemeDefinition = {
dark: false,
......@@ -77,7 +75,6 @@ const tuwThemeDarkContrast: ThemeDefinition = {
export default defineNuxtPlugin(app => {
const vuetify : any = createVuetify({
ssr: true,
components,
directives,
defaults: {
VSelect: {
......
......@@ -1056,17 +1056,9 @@ export function axiosErrorToApiError(error: AxiosError): ApiErrorDto {
message: error.message
}
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) {
const errorObj: ApiErrorDto = (error.response?.data as ApiErrorDto)
if ('data' in error.response) {
const errorObj: ApiErrorDto = (error.response.data as ApiErrorDto)
return errorObj
}
const errorObj: ApiErrorDto = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment