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

batch actions #68

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

batch actions #68

wants to merge 2 commits into from

Conversation

hrushikeshm-g
Copy link
Contributor

No description provided.

@Meetatgoogle
Copy link
Contributor

LGTM

else:
driver_fn(sight)

decision_messages = get_decision_messages_from_proto(
Copy link
Collaborator

Choose a reason for hiding this comment

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

run() is getting long. Please pull this region (e.g. the while (True) stuff that does the actual work) into a separate function

def get_decision_outcome_proto_from_cached(outcome_label: str,
decision_message: DecisionMessage):

logging.info('decision message =>%s', decision_message)
Copy link
Collaborator

Choose a reason for hiding this comment

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

add function comments, remove logging statement (will be very noisy)

def _configure_client_and_worker(sight):
"""Configures the client and worker identifiers."""
if FLAGS.deployment_mode in ["local"] or _TRAINED_MODEL_LOG_ID.value:
global _sight_id
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need this global _sight_id variable? It breaks modularity and I don't see it being used anywhere.

outcome_params: Optional[dict] = None


class CachedBatchMessages:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add class comment



class CachedBatchMessages:
_instance = None # Class-level variable for the singleton instance
Copy link
Collaborator

Choose a reason for hiding this comment

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

To allow for this class to be used from multiple threads or multiple Sight objects it would be more modular to keep explicit references to CachedBatchMessages objects.

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.

3 participants