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

Bump black from 23.10.1 to 24.3.0 #955

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import json
import logging
import shutil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import logging

from datarobot_drum.drum.adapters.cli.shared.drum_class_label_adapter import DrumClassLabelAdapter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import logging
import sys

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import logging
import sys
from typing import Optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import logging
import os
import sys
Expand Down Expand Up @@ -440,9 +441,9 @@ def supported_payload_formats(self):

def model_info(self):
return {
ModelInfoKeys.PREDICTOR: None
if self._predictor_to_use is None
else self._predictor_to_use.name,
ModelInfoKeys.PREDICTOR: (
None if self._predictor_to_use is None else self._predictor_to_use.name
),
}

def load_data(self, binary_data, mimetype, try_hook=True, sparse_colnames=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import logging
import os
from typing import Optional
Expand Down
1 change: 1 addition & 0 deletions custom_model_runner/datarobot_drum/drum/args_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import argparse
import os
import subprocess
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

from abc import ABC, abstractmethod
import logging
from typing import Optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import pickle

from datarobot_drum.drum.artifact_predictors.artifact_predictor import ArtifactPredictor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import sys

import numpy as np
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import pickle

from datarobot_drum.drum.artifact_predictors.artifact_predictor import ArtifactPredictor
Expand Down
1 change: 1 addition & 0 deletions custom_model_runner/datarobot_drum/drum/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import logging
import os
import sys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import logging
from distutils.util import strtobool
from typing import Any, List, Optional, Union
Expand Down
1 change: 1 addition & 0 deletions custom_model_runner/datarobot_drum/drum/description.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

version = "1.10.20"
__version__ = version
project_name = "datarobot-drum"
37 changes: 22 additions & 15 deletions custom_model_runner/datarobot_drum/drum/drum.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import copy
import glob
import json
Expand Down Expand Up @@ -740,12 +741,16 @@ def _prepare_prediction_server_or_batch_pipeline(self, run_language):
"triton_grpc_port": options.triton_grpc_port,
"api_token": options.api_token,
"allow_dr_api_access": options.allow_dr_api_access,
"query_params": '"{}"'.format(options.query)
if getattr(options, "query", None) is not None
else "null",
"content_type": '"{}"'.format(options.content_type)
if getattr(options, "content_type", None) is not None
else "null",
"query_params": (
'"{}"'.format(options.query)
if getattr(options, "query", None) is not None
else "null"
),
"content_type": (
'"{}"'.format(options.content_type)
if getattr(options, "content_type", None) is not None
else "null"
),
"target_type": self.target_type.value,
"user_secrets_mount_path": getattr(options, "user_secrets_mount_path", None),
"user_secrets_prefix": getattr(options, "user_secrets_prefix", None),
Expand All @@ -769,16 +774,18 @@ def _prepare_prediction_server_or_batch_pipeline(self, run_language):
"port": port,
"show_perf": str(options.show_perf).lower(),
"engine_type": "RestModelServing" if options.production else "Generic",
"component_type": "uwsgi_serving"
if options.production
else "prediction_server",
"uwsgi_max_workers": options.max_workers
if getattr(options, "max_workers")
else "null",
"component_type": (
"uwsgi_serving" if options.production else "prediction_server"
),
"uwsgi_max_workers": (
options.max_workers if getattr(options, "max_workers") else "null"
),
"single_uwsgi_worker": (options.max_workers == 1),
"deployment_config": '"{}"'.format(options.deployment_config)
if getattr(options, "deployment_config", None) is not None
else "null",
"deployment_config": (
'"{}"'.format(options.deployment_config)
if getattr(options, "deployment_config", None) is not None
else "null"
),
}
)

Expand Down
1 change: 1 addition & 0 deletions custom_model_runner/datarobot_drum/drum/enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import logging
import os
from enum import Enum
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import logging
import os
import time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import glob
import logging
import os
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import logging
import os

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import logging
import tempfile
import shutil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import logging
import os

Expand Down Expand Up @@ -260,9 +261,11 @@ def _transform(self, **kwargs):
with capture_R_traceback_if_errors(r_handler, logger):
transformations = r_handler.outer_transform(
binary_data=ro.vectors.ByteVector(input_binary_data),
target_binary_data=ro.NULL
if target_binary_data is None
else ro.vectors.ByteVector(target_binary_data),
target_binary_data=(
ro.NULL
if target_binary_data is None
else ro.vectors.ByteVector(target_binary_data)
),
mimetype=ro.NULL if mimetype is None else mimetype,
transformer=self._model,
sparse_colnames=self._get_sparse_colnames(kwargs),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import logging

import requests
Expand Down
1 change: 1 addition & 0 deletions custom_model_runner/datarobot_drum/drum/model_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import json
import os
import re
Expand Down
1 change: 1 addition & 0 deletions custom_model_runner/datarobot_drum/drum/perf_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import collections
import json
import os
Expand Down
1 change: 1 addition & 0 deletions custom_model_runner/datarobot_drum/drum/push.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import os
import re
from pathlib import Path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import os
import psutil

Expand Down
1 change: 1 addition & 0 deletions custom_model_runner/datarobot_drum/drum/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import logging
from datarobot_drum.drum.server import (
empty_api_blueprint,
Expand Down
1 change: 1 addition & 0 deletions custom_model_runner/datarobot_drum/drum/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

from flask import Flask, Blueprint
import os

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import os
import logging
import time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import numbers
import sys
from abc import ABC, abstractmethod
Expand Down
1 change: 1 addition & 0 deletions custom_model_runner/datarobot_drum/drum/utils/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

from typing import List, Tuple, Optional, Union

import numpy as np
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import glob
import json
import logging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import logging
from contextlib import contextmanager

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import io
import logging
import os
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import pandas as pd
import time

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import logging
import urllib
from typing import Optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import logging
import sys
from pathlib import Path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import logging
import os
import sys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import json

from datarobot_drum.drum.exceptions import DrumCommonException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is proprietary source code of DataRobot, Inc. and its affiliates.
Released under the terms of DataRobot Tool and Utility Agreement.
"""

import logging
import os
from typing import Optional
Expand Down
Loading