scrapinghub / scrapinghub/dateparser

search_dates does not work with aws python image 3.12

Open
#1,252 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.9k
Forks
520
Avg merge
22h 56m
Merged PRs (30d)
6

Description

I am using the dateparser.search.search_dates() method in 3.11 and 3.12 library locally and it works fine.

>>> print(sys.version)
3.12.0 (main, Jan 28 2025, 14:59:20) [Clang 16.0.0 (clang-1600.0.26.4)]
>>> from dateparser.search import search_dates
>>> search_dates('The first artificial Earth satellite was launched on 4 October 1957.', languages=['en'])
[('on 4 October 1957', datetime.datetime(1957, 10, 4, 0, 0))]

It works well with OS: Amazon Linux 2 and Runtime: 3.11
FROM public.ecr.aws/lambda/python:3.11

However, it does not work with new base image:
It returns None with OS: Amazon Linux 2023 and Runtime: 3.12
FROM public.ecr.aws/lambda/python:3.12

https://docs.aws.amazon.com/lambda/latest/dg/python-image.html -> Python base images.
I am using dateparser==1.2.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce search_dates() with dateparser==1.2.0 in the public.ecr.aws/lambda/python:3.12 image, comparing it with Python 3.11 and the shown input. Start at the dateparser.search.search_dates entry point and trace why the 3.12/Amazon Linux 2023 environment returns None. Done means the input returns the expected date tuple in the affected image, with a regression test if the existing test layout supports it.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.