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

Fetch request records in batch v1 results #8

Merged
merged 2 commits into from
Jan 17, 2024
Merged

Conversation

jc
Copy link

@jc jc commented Jan 12, 2024

See polytomic/app#7256

@jc jc requested a review from nyergler January 12, 2024 21:33
Copy link

@nyergler nyergler left a comment

Choose a reason for hiding this comment

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

I think you can also get rid of 243-248 since requestRecords will always have been fetched.

bulk/v1/batch.go Outdated
}
jobRecord := bulk.JobRecord{
ID: record.ID,
UnprocessedRecord: bulk.UnprocessedRecord{

Choose a reason for hiding this comment

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

I wonder if this should just be Record (rather than "Unprocessed"). Although I suspect it's the former due to embedding, so maybe not an easy/small change.

Copy link
Author

Choose a reason for hiding this comment

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

I'm a little unsure about this comment.

Are you saying:

		jobRecord := bulk.JobRecord{
			ID: record.ID,
		}
		if record.Success {
			jobRecord.Fields = fields
		} else {
			jobRecord.UnprocessedRecord.Fields = fields
                }

Aren't they equivalent? Since Fields can be accessed either directly on JobRecord or through JobRecord.UnprocessedRecord?

type JobRecord struct {
	ID string
	UnprocessedRecord
}

Choose a reason for hiding this comment

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

I was saying that UnprocessedRecord is sort of a misnomer; it's really Record. So you could image the JobRecord type looking like:

type JobRecord struct {
	ID string
	Record UnprocessedRecord
}

At which point you say, why not just rename UnprocessedRecord to Record.

More of an observation/musing than a request for this PR.

@jc jc merged commit a4670ac into master Jan 17, 2024
1 check passed
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