Skip to content

Commit 2f58677

Browse files
committed
Small bugfixes
- Stop using /tmp but create file locally (and delete it when finished) - Stop dropping the status column (as it's not always "PUBLISHED" as assumed)
1 parent e5b9b80 commit 2f58677

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "hys_scraper"
7-
version = "0.1.3"
7+
version = "0.1.32"
88
description = "Scrape feedback and statistics from the European Commission's 'Have your Say' plattform."
99
readme = "README.md"
1010
classifiers = [

src/hys_scraper/hys_scraper.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def _feedbacks_to_dataframe(
206206

207207
# Drop some unnecessary columns
208208
df = df.drop(
209-
columns=["status", "isMyFeedback", "historyEventOccurs", "_links"],
209+
columns=["isMyFeedback", "historyEventOccurs", "_links"],
210210
errors="ignore",
211211
)
212212

@@ -259,10 +259,7 @@ def _download_attachments(self, df: pd.DataFrame) -> pd.DataFrame:
259259
DataFrame containing the filenames of the downloaded attachments (relative
260260
to target_dir).
261261
"""
262-
# Create a temporary download location
263-
if not os.path.isdir("/tmp/hys_scraper"):
264-
os.mkdir("/tmp/hys_scraper")
265-
tmp_location = "/tmp/hys_scraper/tmp.pdf"
262+
tmp_location = "./.tmp.pdf"
266263

267264
# Get a id, attachment dataframe
268265
df = df[["id", "attachments"]].copy()

0 commit comments

Comments
 (0)