Skip to content

Commit dd55eaf

Browse files
authored
Merge branch 'main' into copilot/fix-blendsearch-udf-warning
2 parents d88ddad + 46a406e commit dd55eaf

37 files changed

+116
-71
lines changed

.github/workflows/python-package.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
fail-fast: false
4141
matrix:
4242
os: [ubuntu-latest, windows-latest]
43-
python-version: ["3.10", "3.11", "3.12"]
43+
python-version: ["3.10", "3.11", "3.12", "3.13"]
4444
steps:
4545
- uses: actions/checkout@v4
4646
- name: Set up Python ${{ matrix.python-version }}
@@ -74,6 +74,11 @@ jobs:
7474
run: |
7575
pip install pyspark==4.0.1
7676
pip list | grep "pyspark"
77+
- name: On Ubuntu python 3.13, install pyspark 4.1.0
78+
if: matrix.python-version == '3.13' && matrix.os == 'ubuntu-latest'
79+
run: |
80+
pip install pyspark==4.1.0
81+
pip list | grep "pyspark"
7782
# # TODO: support ray
7883
# - name: If linux and python<3.11, install ray 2
7984
# if: matrix.os == 'ubuntu-latest' && matrix.python-version < '3.11'

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ repos:
3636
- id: black
3737

3838
- repo: https://github.com/executablebooks/mdformat
39-
rev: 0.7.17
39+
rev: 0.7.22
4040
hooks:
4141
- id: mdformat
4242
additional_dependencies:

NOTICE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ This repository incorporates material as listed below or described in the code.
44

55
## Component. Ray.
66

7-
Code in tune/\[analysis.py, sample.py, trial.py, result.py\],
8-
searcher/\[suggestion.py, variant_generator.py\], and scheduler/trial_scheduler.py is adapted from
7+
Code in tune/[analysis.py, sample.py, trial.py, result.py],
8+
searcher/[suggestion.py, variant_generator.py], and scheduler/trial_scheduler.py is adapted from
99
https://github.com/ray-project/ray/blob/master/python/ray/tune/
1010

1111
## Open Source License/Copyright Notice.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ FLAML has a .NET implementation in [ML.NET](http://dot.net/ml), an open-source,
3434

3535
## Installation
3636

37-
The latest version of FLAML requires **Python >= 3.10 and \< 3.13**. While other Python versions may work for core components, full model support is not guaranteed. FLAML can be installed via `pip`:
37+
The latest version of FLAML requires **Python >= 3.10 and < 3.14**. While other Python versions may work for core components, full model support is not guaranteed. FLAML can be installed via `pip`:
3838

3939
```bash
4040
pip install flaml

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ If you believe you have found a security vulnerability in any Microsoft-owned re
1212

1313
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).
1414

15-
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).
15+
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).
1616

1717
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
1818

flaml/automl/ml.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,14 +311,14 @@ def get_y_pred(estimator, X, eval_metric, task: Task):
311311
else:
312312
y_pred = estimator.predict(X)
313313

314-
if isinstance(y_pred, Series) or isinstance(y_pred, DataFrame):
314+
if isinstance(y_pred, (Series, DataFrame)):
315315
y_pred = y_pred.values
316316

317317
return y_pred
318318

319319

320320
def to_numpy(x):
321-
if isinstance(x, Series or isinstance(x, DataFrame)):
321+
if isinstance(x, (Series, DataFrame)):
322322
x = x.values
323323
else:
324324
x = np.ndarray(x)
@@ -586,7 +586,7 @@ def _eval_estimator(
586586

587587
# TODO: why are integer labels being cast to str in the first place?
588588

589-
if isinstance(val_pred_y, Series) or isinstance(val_pred_y, DataFrame) or isinstance(val_pred_y, np.ndarray):
589+
if isinstance(val_pred_y, (Series, DataFrame, np.ndarray)):
590590
test = val_pred_y if isinstance(val_pred_y, np.ndarray) else val_pred_y.values
591591
if not np.issubdtype(test.dtype, np.number):
592592
# some NLP models return a list

flaml/automl/nlp/utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ def load_default_huggingface_metric_for_task(task):
2525

2626

2727
def is_a_list_of_str(this_obj):
28-
return (isinstance(this_obj, list) or isinstance(this_obj, np.ndarray)) and all(
29-
isinstance(x, str) for x in this_obj
30-
)
28+
return isinstance(this_obj, (list, np.ndarray)) and all(isinstance(x, str) for x in this_obj)
3129

3230

3331
def _clean_value(value: Any) -> str:

flaml/automl/state.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@ def valid_starting_point_one_dim(self, value_one_dim, domain_one_dim):
3737
if isinstance(domain_one_dim, sample.Domain):
3838
renamed_type = list(inspect.signature(domain_one_dim.is_valid).parameters.values())[0].annotation
3939
type_match = (
40-
renamed_type == Any
40+
renamed_type is Any
4141
or isinstance(value_one_dim, renamed_type)
42-
or isinstance(value_one_dim, int)
43-
and renamed_type is float
42+
or (renamed_type is float and isinstance(value_one_dim, int))
4443
)
4544
if not (type_match and domain_one_dim.is_valid(value_one_dim)):
4645
return False

flaml/automl/task/time_series_task.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,8 @@ def _preprocess(self, X, transformer=None):
386386
return X
387387

388388
def preprocess(self, X, transformer=None):
389-
if isinstance(X, pd.DataFrame) or isinstance(X, np.ndarray) or isinstance(X, pd.Series):
390-
X = X.copy()
391-
X = normalize_ts_data(X, self.target_names, self.time_col)
389+
if isinstance(X, (pd.DataFrame, np.ndarray, pd.Series)):
390+
X = normalize_ts_data(X.copy(), self.target_names, self.time_col)
392391
return self._preprocess(X, transformer)
393392
elif isinstance(X, int):
394393
return X

flaml/automl/time_series/ts_data.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -546,14 +546,12 @@ def normalize_ts_data(X_train_all, target_names, time_col, y_train_all=None):
546546

547547

548548
def validate_data_basic(X_train_all, y_train_all):
549-
assert isinstance(X_train_all, np.ndarray) or issparse(X_train_all) or isinstance(X_train_all, pd.DataFrame), (
550-
"X_train_all must be a numpy array, a pandas dataframe, " "or Scipy sparse matrix."
551-
)
549+
assert isinstance(X_train_all, (np.ndarray, DataFrame)) or issparse(
550+
X_train_all
551+
), "X_train_all must be a numpy array, a pandas dataframe, or Scipy sparse matrix."
552552

553-
assert (
554-
isinstance(y_train_all, np.ndarray)
555-
or isinstance(y_train_all, pd.Series)
556-
or isinstance(y_train_all, pd.DataFrame)
553+
assert isinstance(
554+
y_train_all, (np.ndarray, pd.Series, pd.DataFrame)
557555
), "y_train_all must be a numpy array or a pandas series or DataFrame."
558556

559557
assert X_train_all.size != 0 and y_train_all.size != 0, "Input data must not be empty, use None if no data"

0 commit comments

Comments
 (0)