-
Notifications
You must be signed in to change notification settings - Fork 3
multi identifier preference record uploads #444
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
base: main
Are you sure you want to change the base?
Conversation
| allowedIdentifierNames: { | ||
| kind: 'parsed', | ||
| parse: (value: string) => value.split(',').map((s) => s.trim()), | ||
| brief: | ||
| 'Identifiers configured for the run. Comma-separated list of identifier names.', | ||
| }, | ||
| identifierColumns: { | ||
| kind: 'parsed', | ||
| parse: (value: string) => value.split(',').map((s) => s.trim()), | ||
| brief: | ||
| 'Columns in the CSV that should be used as identifiers. Comma-separated list of column names.', | ||
| }, | ||
| columnsToIgnore: { | ||
| kind: 'parsed', | ||
| parse: (value: string) => value.split(',').map((s) => s.trim()), | ||
| brief: | ||
| 'Columns in the CSV that should be ignored. Comma-separated list of column names.', | ||
| optional: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The preferred pattern for lists is to use the built-in variadic: ','. This will parse it in the same way, but it will also (A) provide better error messages for malformed inputs, and (B) it will also self-document that it's a list which can be provided as a comma-separated argument like this:
FLAGS
--auth The Transcend API key.
[--identifierColumns]... Identifier names configured for the run. [separator = ,]
It also allows users to pass --identifierColumns 1 --identifierColumns 2 --identifierColumns 3
And if any of these are enums (I don't think they are, but) you can also do something like this to validate (and also self-document) the expected inputs:

If you
| allowedIdentifierNames: { | |
| kind: 'parsed', | |
| parse: (value: string) => value.split(',').map((s) => s.trim()), | |
| brief: | |
| 'Identifiers configured for the run. Comma-separated list of identifier names.', | |
| }, | |
| identifierColumns: { | |
| kind: 'parsed', | |
| parse: (value: string) => value.split(',').map((s) => s.trim()), | |
| brief: | |
| 'Columns in the CSV that should be used as identifiers. Comma-separated list of column names.', | |
| }, | |
| columnsToIgnore: { | |
| kind: 'parsed', | |
| parse: (value: string) => value.split(',').map((s) => s.trim()), | |
| brief: | |
| 'Columns in the CSV that should be ignored. Comma-separated list of column names.', | |
| optional: true, | |
| allowedIdentifierNames: { | |
| kind: 'parsed', | |
| parse: String, | |
| variadic: ',', | |
| brief: 'Identifier names configured for the run.', | |
| }, | |
| identifierColumns: { | |
| kind: 'parsed', | |
| parse: String, | |
| variadic: ',', | |
| brief: 'Columns in the CSV that should be used as identifiers.', | |
| }, | |
| columnsToIgnore: { | |
| kind: 'parsed', | |
| parse: String, | |
| variadic: ',', | |
| brief: 'Columns in the CSV that should be ignored.', | |
| optional: true, |
| @@ -1,252 +0,0 @@ | |||
| import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restore
a7aa378 to
0be1c91
Compare
536ca21 to
702709e
Compare
| ]); | ||
| currentState.timestampColum = timestampName; | ||
|
|
||
| currentState.setValue(timestampName, 'timestampColumn'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Incorrect Parameter Order in setValue Calls
The setValue calls in parsePreferenceFileFormatFromCsv.ts and parsePreferenceAndPurposeValuesFromCsv.ts pass parameters in the wrong order, using (value, key) instead of the expected (key, value). This is inconsistent with getValue's key-first convention and likely results in incorrect state updates.
Additional Locations (1)
| 'When uploading preferences to v1/preferences - this is the number of concurrent requests made at any given time by a single process.' + | ||
| "This is NOT the batch size—it's how many batch *tasks* run in parallel. " + | ||
| 'The number of total concurrent requests is maxed out at concurrency * uploadConcurrency.', | ||
| default: '75', // FIXME 25 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related Issues
Usage
Note
Introduces a new CLI command to upload preference records from CSV with multi-identifier support, including interactive/batch flows, parsing, GraphQL integration, receipts, and examples.
consent upload-preferencescommand.ts,impl.ts,buildTaskOptions.ts,worker.tsupload/batchUploader.ts,upload/buildInteractiveUploadPlan.ts,upload/interactivePreferenceUploaderFromPlan.ts,upload/types.tsupload/transform/transformCsv.ts,buildPendingUpdates.ts,index.tsartifacts/receipts/index.ts,receiptsState.tsreadme.tsparsePreferenceManagementCsv.ts,parsePreferenceFileFormatFromCsv.ts,parsePreferenceIdentifiersFromCsv.ts,parsePreferenceAndPurposeValuesFromCsv.tsgetPreferencesForIdentifiers.ts,getPreferenceUpdatesFromRow.ts,codecs.ts,uploadPreferenceManagementPreferencesInteractive.ts,index.tscreateSombraGotInstance.ts,makeGraphQLRequest.ts,gqls/RequestDataSilo.tscollectCsvFilesOrExit.ts,pooling/logRotation.tsexamples/pm-test/transcend-yml-schema-v9.json, updates toREADME.mdandCHANGELOG.mdWritten by Cursor Bugbot for commit f8a91f9. This will update automatically on new commits. Configure here.