How do we convert the `handsontable` sample table representation to a PEP-compatible sample table representation?

Aperta
#376 3 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@sanghoonio ci sta già lavorando.

Dal 27/8/2024.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

likely solved
Overview

Probably the most bug-prone step in the sample-table of the PEPhub UI is the conversion of the data-representation used by handsontable to the data-representation used in our database. Specifically, we need to convert an array-of-arrays, into an array-of-objects. You can view the current function deployed now.

Essentially the function must convert this:

[
  ['col1', 'col2', 'col3'],
  ['s1_col1', 's1_col2', 's1_col3'],
  ['s2_col1', 's2_col2', 's2_col3'],
]

Into this:

[
  { col1: 's1_col1', col2: 's1_col2', col3: 's1_col3' },
  { col1: 's2_col1', col2: 's2_col2', col3: 's2_col3' },
]
Things that make it tricky

There are problems with this conversion; moreover questions that need to be answered:

  1. What happens if a user has duplicate column names? This will lead to data-loss as attributes are overwritten
  2. What if a user has an empty column? This leads to objects with null as an attribute (which feels wrong)
  3. What if the user skips a row? Should it be blank or smart enough to know that they don't want that as a sample?

The conversion seems to be lossy by nature. In the interest of trying to balance out not doing magic behind the scenes but also promptly warning the user about potential errors, it becomes quite difficult to write the function, and I am looking for assistance.

Lingua principale
TypeScript
Stelle
22
Fork
2
Merge medio
6g 20h
PR unite (30g)
2

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pepkit/pephub

Tutte le issue di pepkit/pephub

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.