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

Make sure query-planning is disabled for now #97

Merged
merged 1 commit into from
Jun 6, 2024
Merged
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
22 changes: 13 additions & 9 deletions nemo_curator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,23 @@

import dask

# Disable query planning if possible
# https://github.com/NVIDIA/NeMo-Curator/issues/73
if dask.config.get("dataframe.query-planning") is True:
raise NotImplementedError(
"NeMo Curator does not support query planning yet. "
"Please disable query planning before importing "
"`nemo_curator`, `dask.dataframe` or `dask_cudf`."
)
else:
dask.config.set({"dataframe.query-planning": False})


from .modules import *
from .utils.distributed_utils import get_client

# Dask will automatically convert the list score type
# to a string without this option.
# See https://github.com/NVIDIA/NeMo-Curator/issues/33
# This also happens when reading and writing to files

# Disable query planning
# https://github.com/NVIDIA/NeMo-Curator/issues/73
dask.config.set(
{
"dataframe.convert-string": False,
"dataframe.query-planning": False,
}
)
dask.config.set({"dataframe.convert-string": False})
13 changes: 13 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,16 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import dask

# Disable query planning before any tests are loaded
# https://github.com/NVIDIA/NeMo-Curator/issues/73
if dask.config.get("dataframe.query-planning") is True:
raise NotImplementedError(
"NeMo Curator does not support query planning yet. "
"Please disable query planning before importing "
"`nemo_curator`, `dask.dataframe` or `dask_cudf`."
)
else:
dask.config.set({"dataframe.query-planning": False})
Comment on lines +15 to +26
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suppose we could also just import nemo_curator here as well.