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

Windows compat #130

Merged
merged 6 commits into from
Sep 4, 2024
Merged

Windows compat #130

merged 6 commits into from
Sep 4, 2024

Conversation

IsaacMilarky
Copy link
Collaborator

Fix Paths Not Being Windows-Friendly

Problem

Right now the Paths in the CLI assume unix style paths. Although, we want to support Windows users.

Solution

Used the os and tempfile modules to make the CLI platform agnostic.

Result

Summary:

  • Replaced string concatenation with os.path.join
  • Used tempfile module to get the OS' tempfile directory
  • Upgraded Faker

Test Plan

Sarah will run this on her Windows machine 🪟

Signed-off-by: Isaac Milarsky <imilarsky@gmail.com>
Signed-off-by: Isaac Milarsky <imilarsky@gmail.com>
Signed-off-by: Isaac Milarsky <imilarsky@gmail.com>
Signed-off-by: Isaac Milarsky <imilarsky@gmail.com>
Signed-off-by: Isaac Milarsky <imilarsky@gmail.com>
@@ -56,8 +57,12 @@ def dedupe_data(fmt,bad_data_path, output_path,linker=None): #pylint: disable=un
unique_records = deduped_record_mapping.drop_duplicates(subset=['cluster_id'])
#cache results
#TODO: make platform agnostic
Copy link

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
W0511: TODO: make platform agnostic (fixme)

Signed-off-by: Isaac Milarsky <imilarsky@gmail.com>
import pandas as pd
import click
from splink import block_on
from deduplifhirLib.utils import use_linker


CACHE_DIR = "/tmp/"
CACHE_DIR = tempfile.gettempdir()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

From Python Docs:

A platform-specific location:

  • On Windows, the directories C:\TEMP, C:\TMP, \TEMP, and \TMP, in that order.

  • On all other platforms, the directories /tmp, /var/tmp, and /usr/tmp, in that order.

@IsaacMilarky IsaacMilarky merged commit 19c55d6 into dev Sep 4, 2024
8 checks passed
@IsaacMilarky IsaacMilarky deleted the windows-compat branch September 4, 2024 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant