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

[card-client] make Card.get_data more efficient #1750

Merged
merged 3 commits into from
Feb 24, 2024

Conversation

valayDave
Copy link
Collaborator

No description provided.

Comment on lines +64 to +69
data_paths = self._card_ds.extract_data_paths(
card_type=self.type, card_hash=self.hash, card_id=self._card_id
)
if len(data_paths) == 0:
return None
self._data_path = data_paths[0]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

s3 list calls are costly so caching the location is useful.

- Helps ensure that stale updates from a server can be ignored
return {
"reload_token": _reload_token(),
"data": json_msg,
"created_on": time.time(),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

driveby change: add a timestamp in the dataupdate call. It helps discard data updates that maybe stale.

@@ -14,8 +14,6 @@ export const cardData: Writable<types.CardResponse | undefined> =
(window as any).metaflow_card_update = (
dataChanges: Record<string, types.CardComponent>
) => {
console.log("metaflow_card_update", dataChanges, cardData?.update);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Driveby change: remove un-necessary console.log

@savingoyal savingoyal merged commit 4f78e8f into Netflix:master Feb 24, 2024
33 of 34 checks passed
@valayDave valayDave deleted the card/optimization-tweek-1 branch April 18, 2024 00:23
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