Skip to content

Commit 0464b15

Browse files
authored
Merge pull request #399 from jverce/fix/emoji-parquet-path
Point to the parquet file based on module path
2 parents 78e07fc + a4f8f1b commit 0464b15

File tree

9 files changed

+28
-16
lines changed

9 files changed

+28
-16
lines changed

HISTORY.rst

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
Change Log - advertools
33
=======================
44

5+
0.16.5 (2025-03-19)
6+
-------------------
7+
8+
* Fixed
9+
- Issue with loading parquet emoji file (issue https://github.com/eliasdabbas/advertools/issues/398)
10+
511
0.16.4 (2024-12-19)
612
-------------------
713

@@ -124,7 +130,7 @@ Change Log - advertools
124130
- Allow optional trailing space in log files (contributed by @andypayne)
125131

126132
* Fixed
127-
- Replace newlines with spaces while parsing JSON-LD which was causing
133+
- Replace newlines with spaces while parsing JSON-LD which was causing
128134
errors in some cases.
129135

130136

@@ -140,7 +146,7 @@ Change Log - advertools
140146
parameter
141147

142148
* Fixed
143-
- Clarify that while authenticating for Twitter only ``app_key`` and
149+
- Clarify that while authenticating for Twitter only ``app_key`` and
144150
``app_secret`` are required, with the option to provide ``oauth_token``
145151
and ``oauth_token_secret`` if/when needed.
146152

@@ -210,7 +216,7 @@ Change Log - advertools
210216
* Changed
211217
- Query parameter columns in ``url_to_df`` DataFrame are now sorted by how
212218
full the columns are (the percentage of values that are not `NA`)
213-
219+
214220
0.11.1 (2021-04-09)
215221
-------------------
216222

@@ -467,7 +473,7 @@ Change Log - advertools
467473
feeling (+ve or -ve).
468474

469475
- New function `word_tokenize`:
470-
476+
471477
* Used by `word_frequency` to get tokens of
472478
1,2,3-word phrases (or more).
473479
* Split a list of text into tokens of a specified number of words each.
@@ -540,7 +546,7 @@ Change Log - advertools
540546
* New function `serp_youtube`
541547
- Query YouTube API for videos, channels, or playlists
542548
- Multiple queries (product of parameters) in one function call
543-
- Reponse looping and merging handled, one DataFrame
549+
- Reponse looping and merging handled, one DataFrame
544550
* `serp_goog` return Google's original error messages
545551
* twitter responses with entities, get the entities extracted, each in a
546552
separate column
@@ -578,7 +584,7 @@ Change Log - advertools
578584
------------------
579585

580586
* New set of kw_<match-type> functions.
581-
* Full testing and coverage.
587+
* Full testing and coverage.
582588

583589
0.1.0 (2018-07-02)
584590
------------------

advertools/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
__author__ = """Elias Dabbas"""
44
__email__ = "eliasdabbas@gmail.com"
5-
__version__ = "0.16.4"
5+
__version__ = "0.16.5"
66

77
from advertools.ad_create import ad_create
88
from advertools.ad_from_string import ad_from_string

advertools/emoji.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,14 @@
114114
EMOJI = re.compile(EMOJI_RAW)
115115

116116

117+
def _emoji_df_path() -> str:
118+
from os.path import join
119+
return join("advertools", "pkg_data", "emoji_df.parquet")
120+
121+
117122
def _emoji_entries(emoji):
118123
emoji_df = pd.read_parquet(
119-
"advertools/emoji_df.parquet",
124+
_emoji_df_path(),
120125
columns=["emoji", "name", "group", "sub_group"],
121126
filters=[("emoji", "in", set(emoji))],
122127
)
@@ -262,8 +267,7 @@ def emoji_search(regex):
262267
5 1F537 fully-qualified 🔷 large blue diamond Symbols geometric
263268
6 1F539 fully-qualified 🔹 small blue diamond Symbols geometric
264269
"""
265-
emoji_df_path = adv.__path__[0] + "/emoji_df.parquet"
266-
emoji_df = pd.read_parquet(emoji_df_path)
270+
emoji_df = pd.read_parquet(_emoji_df_path())
267271
result_index = (
268272
emoji_df.select_dtypes("object")
269273
.apply(lambda series: series.astype(str).str.contains(regex, case=False))

docs/_build/html/_static/documentation_options.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const DOCUMENTATION_OPTIONS = {
2-
VERSION: '0.16.4',
2+
VERSION: '0.16.5',
33
LANGUAGE: 'en',
44
COLLAPSE_INDEX: false,
55
BUILDER: 'html',
@@ -10,4 +10,4 @@ const DOCUMENTATION_OPTIONS = {
1010
NAVIGATION_WITH_KEYS: false,
1111
SHOW_SEARCH_SUMMARY: true,
1212
ENABLE_SEARCH_SHORTCUTS: true,
13-
};
13+
};

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,19 @@ keywords = ["seo", "marketing", "advertising", "adwords", "bingads", "search-eng
2828
advertools = "advertools.cli:main"
2929
adv = "advertools.cli:main"
3030

31-
3231
[project.urls]
3332
Homepage = "https://adver.tools"
3433
Documentation = "https://advertools.readthedocs.io"
3534
Repository = "https://github.com/eliasdabbas/advertools.git"
3635
Issues = "https://github.com/eliasdabbas/advertools/issues"
3736
Changelog = "https://github.com/eliasdabbas/advertools/blob/master/HISTORY.rst"
3837

38+
[tool.flit.external-data]
39+
directory = "advertools/pkg_data"
40+
3941
[tool.ruff]
4042
target-version = "py37"
4143

42-
4344
[tool.ruff.lint]
4445
# Add the `line-too-long` rule to the enforced rule set.
4546
extend-select = ["E501"]

requirements_dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
pip
2+
build
23
wheel
34
flake8
45
tox

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.16.4
2+
current_version = 0.16.5
33
commit = True
44
tag = True
55

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,6 @@
6262
test_suite="tests",
6363
tests_require=test_requirements,
6464
url="https://github.com/eliasdabbas/advertools",
65-
version="0.16.4",
65+
version="0.16.5",
6666
zip_safe=False,
6767
)

0 commit comments

Comments
 (0)