Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ices-eg/wg_WGEEL
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricbriandgithub committed Sep 7, 2022
2 parents f2ae5e6 + 04639eb commit cd17cad
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 18 deletions.
63 changes: 51 additions & 12 deletions Misc/data_call_2022/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@

### to do
* pre-filled series ending with "HIST" and related group metrics should be deleted. It's not clear to the data provider how these are generated and if they are reliable.
* integrate individual metrics, there was a bug...

### done
* group metrics: 137 and 1509 new values inserted in the group and metric tables
Expand All @@ -153,7 +154,7 @@

## Annex 4


552 new rows entered

## Annex 5

Expand Down Expand Up @@ -661,31 +662,31 @@ Issue with integrating individual data
# NO (Norway)
-----------------------------------------------------------
## Annex 1

It is done

## Annex 2

It is done
## Annex 3


It is done
## Annex 4


It is done

## Annex 5


No data
## Annex 6


No data
## Annex 7

No data
## Annex 8

No data


## Annex 10

No data
-----------------------------------------------------------
# PL
-----------------------------------------------------------
Expand Down Expand Up @@ -719,12 +720,43 @@ Issue with integrating individual data
# PT
-----------------------------------------------------------
## Annex 1
### done
* 1 updated series (modified series)
* 3 new values inserted in the database (new dataseries)
* updated two values (new dataseries)
* 5826 and 11652 new values inserted in the fish and metric tables (new individual metrics)
* 2 and 6 values inserted (new group metrics)


## Annex 2

### done
* 2 values integrated (new dataseries)
* 2 and 4 new values integrated (new group metrics)
* 437 and 2413 values integrated (new individual metrics)

### to do
* integrate modified group metrics (update group metrics): Error: Anenex 2could not find function "update_group_metrics"
* integrate deleted group metrics. It caused an error: Anex 2 -Failed to prepare query: ERROR: invalid input syntax for type integer: ""
LINE 1: ...ELECT ser_cou_code FROM datawg.t_series_ser WHERE ser_id='';


## Annex 3
### notes
pressed proceed for "delete dataseries" but no file was browsed, still said 2 values deleted...

### done
* 2 values updated (modified series)
* 2 new values (new dataseries)
* 2 and 10 new values (new group metrics) - pressed proceed twice, second caused error
* 147 and 902 new values integrated (new individual metrics)

### to do
* integrate "delete group metrics": delete group metrics caused an error when proceeding: Failed to prepare query: ERROR: invalid input syntax for type integer: ""
LINE 1: ...ELECT ser_cou_code FROM datawg.t_series_ser WHERE ser_id='';

* integrate modified group metrics: integration caused an errror: Failed to prepare query: ERROR: invalid input syntax for type integer: ""
LINE 1: ...ELECT ser_cou_code FROM datawg.t_series_ser WHERE ser_id='';

## Annex 4

Expand All @@ -748,7 +780,13 @@ Issue with integrating individual data
# SE
-----------------------------------------------------------
## Annex 1
Modified series: 1 value updated in the db

New dataseries: 9 values inserted in the db

Modified dataseries: 620 values updated in the db (added a quality id)

New group metrics: 4 and 4 new values inserted in the group and metric tables

## Annex 2
New dataseries: 2 new values inserted in the database (new years)
Expand All @@ -769,12 +807,13 @@ Integrate new rows: Uploaded 36 new rows


## Annex 6

New rows: 4 new values inserted in the database

## Annex 7
New rows: 8 new values in the database

## Annex 8

New rows: 1 new values inserted in the database


## Annex 10
Expand Down
4 changes: 2 additions & 2 deletions R/shiny_data_integration/shiny_di/database_tools.R
Original file line number Diff line number Diff line change
Expand Up @@ -2099,15 +2099,15 @@ update_dataseries <- function(path) {
#' path <- file.choose()

write_new_group_metrics <- function(path, type="series") {

conn <- poolCheckout(pool)
on.exit(poolReturn(conn))
if (type == "series"){
fk <- "grser_ser_id"
} else{
fk <- "grsa_sai_id"
}
new <- read_excel(path = path, sheet = 1, skip = 1)
new <- read_excel(path = path, sheet = 1, skip = 1) %>%
mutate(gr_number=as.numeric(gr_number))
if (nrow(new) == 0){
message <- "nothing to import"
cou_code <- ""
Expand Down
8 changes: 4 additions & 4 deletions R/shiny_data_integration/shiny_di/importdcfstep1.R
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ importdcfstep1Server <- function(id,globaldata,loaded_data_dcf){
scrollX = T,
buttons=list(
list(extend="excel",
filename = paste0("modified_group_metrics_",loaded_data_cdf$file_type,"_",Sys.Date(),"_",current_cou_code)))
filename = paste0("modified_group_metrics_",loaded_data_dcf$file_type,"_",Sys.Date(),"_",current_cou_code)))
))
})

Expand Down Expand Up @@ -673,7 +673,7 @@ importdcfstep1Server <- function(id,globaldata,loaded_data_dcf){
scrollX = T,
buttons=list(
list(extend="excel",
filename = paste0("modified_individual_metrics_",loaded_data_cdf$file_type,"_",Sys.Date(),"_",current_cou_code)))
filename = paste0("modified_individual_metrics_",loaded_data_dcf$file_type,"_",Sys.Date(),"_",current_cou_code)))
))
})

Expand Down Expand Up @@ -729,7 +729,7 @@ importdcfstep1Server <- function(id,globaldata,loaded_data_dcf){
scrollX = T,
buttons=list(
list(extend="excel",
filename = paste0("deleted_group_metrics_",loaded_data_cdf$file_type,"_",Sys.Date(),"_",current_cou_code)))
filename = paste0("deleted_group_metrics_",loaded_data_dcf$file_type,"_",Sys.Date(),"_",current_cou_code)))
))
})
}
Expand Down Expand Up @@ -772,7 +772,7 @@ importdcfstep1Server <- function(id,globaldata,loaded_data_dcf){
scrollX = T,
buttons=list(
list(extend="excel",
filename = paste0("deleted_individual_metrics_",loaded_data_cdf$file_type,"_",Sys.Date(),"_",current_cou_code)))
filename = paste0("deleted_individual_metrics_",loaded_data_dcf$file_type,"_",Sys.Date(),"_",current_cou_code)))
))
})
}
Expand Down

0 comments on commit cd17cad

Please sign in to comment.