-
Notifications
You must be signed in to change notification settings - Fork 5k
fix-spelling-error,-code-bug,-and-improve-test #1991
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
base: main
Are you sure you want to change the base?
Conversation
…ode-bug,-and-improve-test Fix path helper and documentation in utils
@microsoft-github-policy-service agree |
|
Hi, @TianqiTang1117 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from typing import Dict, Tuple, Union, Callable, List
from typing import Dict, Tuple, Callable, List
import bisect
import numpy as np
import pandas as pd
def concat(data_list: Union[SingleData], axis=0) -> MultiData:
"""concat all SingleData by index.
def concat(data_list: List["SingleData"], axis=0) -> "MultiData":
"""Concat multiple :class:SingleData objects by index.
TODO: now just for SingleData.
Parameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from typing import Dict, Tuple, Union, Callable, List
from typing import Dict, Tuple, Callable, List
import bisect
import numpy as np
import pandas as pd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if return_dir:
_, path = tempfile.mkdtemp(dir=temp_dir)
# mkdtemp returns the created directory path directly, while mkstemp
# returns a tuple of (fd, path). The previous implementation tried to
# unpack the return value of mkdtemp into two variables, which raises a
# ValueError at runtime. This branch should therefore assign the path
# directly without unpacking.
path = tempfile.mkdtemp(dir=temp_dir)
else:
_, path = tempfile.mkstemp(dir=temp_dir)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from typing import Dict, Tuple, Union, Callable, List
from typing import Dict, Tuple, Callable, List
import bisect
import numpy as np
import pandas as pd
Summary
Testing
python -m pytest tests/misc/test_file_utils.py -q