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

Dataset preview data #143

Merged
merged 1 commit into from
Sep 9, 2024
Merged

Dataset preview data #143

merged 1 commit into from
Sep 9, 2024

Conversation

andresgutgon
Copy link
Contributor

@andresgutgon andresgutgon commented Sep 6, 2024

What?

Preview dataset CSV data

TODO

  • Load data from CSV (100 first rows)
  • Table for showing CSV data
  • Implement csv delimiter picker
  • Tabs csv example not working
  • Add unique dataset name by workspace validation in server action
  • Table skeleton
const COMMON_DELIMITERS = [',', '\t', ' ', ';'];
image

@andresgutgon andresgutgon added the 🚧 wip Work in progress label Sep 6, 2024
import { syncReadCsv } from '../../lib/readCsv'

/**
* This service pick the first N rows of a CSV file
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

csv lib we use also has from so we can implement some kind of pagination in the future

@andresgutgon andresgutgon force-pushed the feature/dataset-previews branch from 1aab329 to 9ffc6f6 Compare September 7, 2024 15:53
@andresgutgon andresgutgon force-pushed the feature/datasets-data-model branch from ee4887c to c026196 Compare September 7, 2024 16:20
@andresgutgon andresgutgon force-pushed the feature/dataset-previews branch from 9ffc6f6 to 084805a Compare September 7, 2024 16:34
@andresgutgon andresgutgon removed the 🚧 wip Work in progress label Sep 9, 2024
@andresgutgon andresgutgon force-pushed the feature/dataset-previews branch from e50fcc4 to a462d73 Compare September 9, 2024 08:49
Base automatically changed from feature/datasets-data-model to main September 9, 2024 08:54
@andresgutgon andresgutgon force-pushed the feature/dataset-previews branch from a462d73 to 089b834 Compare September 9, 2024 08:59
Comment on lines 24 to 25
const MAX_SIZE = 3
const MAX_UPLOAD_SIZE_IN_MB = 3 * 1024 * 1024
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpicking but use MAX_SIZE to calculate MAX_SIZE_IN_MB

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No good catch 💯 . This needs to be changed to 15MB now. I forgot thanks

Comment on lines +46 to +49
csvDelimiter: z.enum(DELIMITERS_KEYS, {
message: 'Choose a valid delimiter option',
}),
csvCustomDelimiter: z.string(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't csvCustomDelimiter be optional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ok, we always send an empty string because the field is always sent. Is in the validation that we check user picked custom and this field has content

Copy link
Contributor

@csansoon csansoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor comments

@andresgutgon andresgutgon merged commit 77c9d66 into main Sep 9, 2024
3 checks passed
@andresgutgon andresgutgon deleted the feature/dataset-previews branch September 9, 2024 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants