Skip to content

Commit

Permalink
Expand the line ranges covered by some # pytype: disable directives.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 597090666
  • Loading branch information
rchen152 authored and Responsible ML Infra Team committed Jan 10, 2024
1 parent 70da8f0 commit 2aca950
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,23 +91,24 @@ def is_active(self):
self._multiplexer.PluginRunToTagToContent(
FairnessIndicatorsPlugin.plugin_name))

# pytype: disable=wrong-arg-types
@wrappers.Request.application
def _serve_js(self, request): # pytype: disable=wrong-arg-types
def _serve_js(self, request):
filepath = os.path.join(os.path.dirname(__file__), 'static', 'index.js')
with open(filepath) as infile:
contents = infile.read()
return http_util.Respond(
request, contents, content_type='application/javascript')

@wrappers.Request.application
def _serve_vulcanized_js(self, request): # pytype: disable=wrong-arg-types
def _serve_vulcanized_js(self, request):
with open(_TEMPLATE_LOCATION) as infile:
contents = infile.read()
return http_util.Respond(
request, contents, content_type='application/javascript')

@wrappers.Request.application
def _get_evaluation_result(self, request): # pytype: disable=wrong-arg-types
def _get_evaluation_result(self, request):
run = request.args.get('run')
try:
run = six.ensure_text(run)
Expand Down Expand Up @@ -136,7 +137,7 @@ def _get_output_file_format(self, evaluation_output_path):
return ''

@wrappers.Request.application
def _get_evaluation_result_from_remote_path(self, request): # pytype: disable=wrong-arg-types
def _get_evaluation_result_from_remote_path(self, request):
evaluation_output_path = request.args.get('evaluation_output_path')
try:
evaluation_output_path = six.ensure_text(evaluation_output_path)
Expand All @@ -153,3 +154,4 @@ def _get_evaluation_result_from_remote_path(self, request): # pytype: disable=w
logging.info('Error while fetching evaluation data, %s', error)
data = []
return http_util.Respond(request, data, content_type='application/json')
# pytype: enable=wrong-arg-types

0 comments on commit 2aca950

Please sign in to comment.