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

Add localTitle function with Test for 'en' and 'nl' #1481

Open
wants to merge 3 commits into
base: 1.x
Choose a base branch
from

Conversation

f-lapinski
Copy link
Contributor

Change Log

Added

  • localeTitle function added with test coverage of 'en' and 'nl' examples and return type

Fixed

Changed

Removed

Deprecated

Security


Description

Added function localeTitle() changes all graphemes/code points to "title case" according to locale-specific case mappings.

For example:

  • - localeTitle('en')
  • Copy link
    Contributor

    github-actions bot commented Feb 14, 2025

    Flow PHP - Benchmarks

    Results of the benchmarks from this PR are compared with the results from 1.x branch.

    Extractors
    +-----------------------+-------------------+------+-----+-----------------+------------------+-----------------+
    | benchmark             | subject           | revs | its | mem_peak        | mode             | rstdev          |
    +-----------------------+-------------------+------+-----+-----------------+------------------+-----------------+
    | CSVExtractorBench     | bench_extract_10k | 1    | 3   | 4.801mb +0.02%  | 554.313ms +0.37% | ±1.20% +768.92% |
    | JsonExtractorBench    | bench_extract_10k | 1    | 3   | 4.874mb +0.01%  | 1.056s -0.78%    | ±0.60% +33.69%  |
    | ParquetExtractorBench | bench_extract_10k | 1    | 3   | 86.319mb +0.00% | 908.537ms +1.38% | ±0.60% +37.75%  |
    | TextExtractorBench    | bench_extract_10k | 1    | 3   | 4.531mb +0.02%  | 35.393ms -1.20%  | ±1.09% +195.31% |
    | XmlExtractorBench     | bench_extract_10k | 1    | 3   | 4.505mb +0.02%  | 610.769ms -0.17% | ±0.64% +21.24%  |
    +-----------------------+-------------------+------+-----+-----------------+------------------+-----------------+
    
    Transformers
    +-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
    | benchmark                   | subject                  | revs | its | mem_peak         | mode            | rstdev         |
    +-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
    | RenameEntryTransformerBench | bench_transform_10k_rows | 1    | 3   | 127.327mb +0.00% | 72.685ms +4.05% | ±0.64% -45.65% |
    +-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
    
    Loaders
    +--------------------+----------------+------+-----+------------------+------------------+-----------------+
    | benchmark          | subject        | revs | its | mem_peak         | mode             | rstdev          |
    +--------------------+----------------+------+-----+------------------+------------------+-----------------+
    | CSVLoaderBench     | bench_load_10k | 1    | 3   | 64.000mb +0.00%  | 106.479ms +0.49% | ±0.78% -23.41%  |
    | JsonLoaderBench    | bench_load_10k | 1    | 3   | 84.347mb +0.00%  | 98.441ms +0.10%  | ±0.24% -7.40%   |
    | ParquetLoaderBench | bench_load_10k | 1    | 3   | 161.190mb +0.00% | 20.715s +0.62%   | ±0.09% -73.30%  |
    | TextLoaderBench    | bench_load_10k | 1    | 3   | 17.997mb +0.00%  | 31.527ms +0.98%  | ±0.78% +104.42% |
    +--------------------+----------------+------+-----+------------------+------------------+-----------------+
    
    Building Blocks
    +-------------------+----------------------------+------+-----+------------------+------------------+-----------------+
    | benchmark         | subject                    | revs | its | mem_peak         | mode             | rstdev          |
    +-------------------+----------------------------+------+-----+------------------+------------------+-----------------+
    | EntryFactoryBench | bench_entry_factory        | 1    | 3   | 105.970mb +0.00% | 456.467ms -1.48% | ±1.04% -39.98%  |
    | EntryFactoryBench | bench_entry_factory        | 1    | 3   | 55.161mb +0.00%  | 232.826ms +2.79% | ±1.41% -23.92%  |
    | EntryFactoryBench | bench_entry_factory        | 1    | 3   | 14.683mb +0.00%  | 50.282ms +0.60%  | ±0.28% -60.59%  |
    | TypeDetectorBench | bench_type_detector        | 1    | 3   | 43.805mb +0.00%  | 362.812ms -0.80% | ±0.53% -17.67%  |
    | TypeDetectorBench | bench_type_detector        | 1    | 3   | 11.615mb +0.01%  | 73.665ms +1.10%  | ±1.20% +89.21%  |
    | RowsBench         | bench_chunk_10_on_10k      | 2    | 3   | 97.014mb +0.00%  | 3.419ms +7.43%   | ±3.43% +255.97% |
    | RowsBench         | bench_diff_left_1k_on_10k  | 2    | 3   | 114.299mb +0.00% | 188.246ms -0.15% | ±2.41% +196.04% |
    | RowsBench         | bench_diff_right_1k_on_10k | 2    | 3   | 97.019mb +0.00%  | 18.693ms -1.44%  | ±0.29% +43.12%  |
    | RowsBench         | bench_drop_1k_on_10k       | 2    | 3   | 97.888mb +0.00%  | 1.687ms +19.86%  | ±1.66% -51.20%  |
    | RowsBench         | bench_drop_right_1k_on_10k | 2    | 3   | 97.888mb +0.00%  | 1.709ms +18.28%  | ±2.83% +99.63%  |
    | RowsBench         | bench_entries_on_10k       | 2    | 3   | 96.049mb +0.00%  | 4.746ms +5.41%   | ±2.67% +128.51% |
    | RowsBench         | bench_filter_on_10k        | 2    | 3   | 96.578mb +0.00%  | 16.773ms -1.73%  | ±1.13% +71.38%  |
    | RowsBench         | bench_find_on_10k          | 2    | 3   | 96.578mb +0.00%  | 16.947ms -2.53%  | ±0.29% -82.53%  |
    | RowsBench         | bench_find_one_on_10k      | 10   | 3   | 95.269mb +0.00%  | 1.994μs 0.00%    | ±2.40% 0.00%    |
    | RowsBench         | bench_first_on_10k         | 10   | 3   | 95.269mb +0.00%  | 0.400μs +33.33%  | ±0.00% +0.00%   |
    | RowsBench         | bench_flat_map_on_1k       | 2    | 3   | 104.487mb +0.00% | 14.722ms +0.76%  | ±0.91% +117.77% |
    | RowsBench         | bench_map_on_10k           | 2    | 3   | 134.555mb +0.00% | 73.804ms +4.06%  | ±1.54% +105.57% |
    | RowsBench         | bench_merge_1k_on_10k      | 2    | 3   | 97.098mb +0.00%  | 1.400ms +13.06%  | ±2.23% +28.11%  |
    | RowsBench         | bench_partition_by_on_10k  | 2    | 3   | 100.399mb +0.00% | 64.672ms +0.18%  | ±0.28% -33.27%  |
    | RowsBench         | bench_remove_on_10k        | 2    | 3   | 98.150mb +0.00%  | 3.852ms +2.03%   | ±1.39% -25.32%  |
    | RowsBench         | bench_sort_asc_on_1k       | 2    | 3   | 95.561mb +0.00%  | 42.539ms +1.41%  | ±0.70% +36.33%  |
    | RowsBench         | bench_sort_by_on_1k        | 2    | 3   | 95.561mb +0.00%  | 42.710ms +1.67%  | ±0.39% -75.46%  |
    | RowsBench         | bench_sort_desc_on_1k      | 2    | 3   | 95.561mb +0.00%  | 42.560ms +0.51%  | ±0.77% -29.17%  |
    | RowsBench         | bench_sort_entries_on_1k   | 2    | 3   | 97.710mb +0.00%  | 8.224ms +0.15%   | ±0.49% -8.42%   |
    | RowsBench         | bench_sort_on_1k           | 2    | 3   | 95.460mb +0.00%  | 30.469ms +3.75%  | ±2.49% +416.11% |
    | RowsBench         | bench_take_1k_on_10k       | 10   | 3   | 95.269mb +0.00%  | 14.394μs +4.08%  | ±0.33% -80.56%  |
    | RowsBench         | bench_take_right_1k_on_10k | 10   | 3   | 95.269mb +0.00%  | 16.807μs +9.85%  | ±1.86% +248.25% |
    | RowsBench         | bench_unique_on_1k         | 2    | 3   | 114.300mb +0.00% | 188.205ms -1.93% | ±0.53% +45.67%  |
    +-------------------+----------------------------+------+-----+------------------+------------------+-----------------+
    

    Copy link

    codecov bot commented Feb 14, 2025

    Codecov Report

    Attention: Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.

    Project coverage is 83.08%. Comparing base (d03af95) to head (c845794).
    Report is 3 commits behind head on 1.x.

    Additional details and impacted files
    @@           Coverage Diff           @@
    ##              1.x    #1481   +/-   ##
    =======================================
      Coverage   83.08%   83.08%           
    =======================================
      Files         666      667    +1     
      Lines       17899    17913   +14     
    =======================================
    + Hits        14871    14883   +12     
    - Misses       3028     3030    +2     
    Components Coverage Δ
    etl 85.84% <85.71%> (-0.01%) ⬇️
    cli 86.73% <ø> (ø)
    lib-array-dot 94.53% <ø> (ø)
    lib-azure-sdk 62.56% <ø> (ø)
    lib-doctrine-dbal-bulk 97.43% <ø> (ø)
    lib-filesystem 76.75% <ø> (ø)
    lib-parquet 84.33% <ø> (ø)
    lib-parquet-viewer 82.02% <ø> (ø)
    lib-rdsl 87.09% <ø> (ø)
    lib-snappy 90.69% <ø> (ø)
    bridge-filesystem-async-aws 90.38% <ø> (ø)
    bridge-filesystem-azure 89.92% <ø> (ø)
    bridge-monolog-http 96.38% <ø> (ø)
    symfony-http-foundation 77.10% <ø> (ø)
    adapter-chartjs 86.45% <ø> (ø)
    adapter-csv 89.57% <ø> (ø)
    adapter-doctrine 88.68% <ø> (ø)
    adapter-elasticsearch 97.19% <ø> (ø)
    adapter-google-sheet 78.04% <ø> (ø)
    adapter-http 59.15% <ø> (ø)
    adapter-json 90.62% <ø> (ø)
    adapter-logger 53.84% <ø> (ø)
    adapter-meilisearch 97.75% <ø> (ø)
    adapter-parquet 80.85% <ø> (ø)
    adapter-text 84.44% <ø> (ø)
    adapter-xml 83.15% <ø> (ø)

    @norberttech
    Copy link
    Member

    hey! Let me think about this one as I'm not fully sure how to handle intl dependency in this case, need to check if we are not bringing a polyfill already anyway.

    @f-lapinski
    Copy link
    Contributor Author

    Sure, no problem :)

    @stloyd
    Copy link
    Member

    stloyd commented Feb 14, 2025

    As additional comment I have already had that issue with adding "yet more option/required" extension, and my thought was that maybe it's time to make new package like "ETL-extra"/"etl-string-functions" or whatever would be best fit, but to move most "depending" functions out of main package, same way we have adapters or bridges.

    @norberttech
    Copy link
    Member

    Yeah, moving functions based on extensions/libraries to standalone packages (libs/bridges) is the way to go.
    My only challenge here is how to make it part of the ScalaFunctionChain so IDE can autocomplete it when we type ref('...')-> 🤔

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    3 participants