Skip to content

Add new connectors (Phase 2)#52

Merged
hallvictoria merged 11 commits into
mainfrom
hallvictoria/add-connectors-p2
Jul 13, 2026
Merged

Add new connectors (Phase 2)#52
hallvictoria merged 11 commits into
mainfrom
hallvictoria/add-connectors-p2

Conversation

@hallvictoria

@hallvictoria hallvictoria commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds 10 new connector clients to the Azure Connectors Python SDK with comprehensive test coverage and usage samples. This is Phase 2 of the connector rollout, expanding the SDK to support additional cloud storage providers, productivity tools, and RSS feeds.
Fixes: https://github.com/Azure/azure-functions-bucees-planning/issues/1148

Paired Generator PR

Changes

Connectors Added (10 total)

  • Box (box.py)
  • Dropbox (dropbox.py)
  • Excel Online (excelonline.py)
  • FTP (ftp.py)
  • Google Calendar (googlecalendar.py)
  • Google Drive (googledrive.py)
  • Google Tasks (googletasks.py)
  • Office 365 Groups Mail (office365groupsmail.py)
  • One Drive for Business (onedriveforbusiness.py)
  • RSS (rss.py)

Testing

  • Unit tests added/updated
  • All existing tests pass (pytest)
  • Linting passes (flake8 src/ tests/)
  • Manual testing (describe below if applicable)

Checklist

  • Code follows the project's coding conventions
  • No modifications to generated connector files in src/azure/connectors/*.py (unless regenerated)
  • Type hints added to all public API signatures
  • Documentation updated (if behavior changed)
  • CHANGELOG.md updated (if user-facing change)

- Remove unused datetime imports from box.py, dropbox.py, ftp.py, googlecalendar.py, googledrive.py, office365groupsmail.py, onedrive.py
- Remove unused field, Any, Dict imports from googletasks.py, rss.py
- Fix line-too-long in office365groupsmail.py by extracting expand_value variable
- All 2072 tests now pass including flake8
In Python 3.10 and 3.11, f-strings cannot nest the same quote type.
Changed inner quotes to single quotes in 6 locations:
- Line 735: quote('attachments')
- Line 806: quote('id,lastDeliveredDateTime')
- Line 809: quote('lastDeliveredDateTime desc')
- Line 966: quote('groupTypes/any(c:c eq \\'Unified\\')')
- Line 967: quote('id,displayName')
- Line 968: quote('999')

This fixes the SyntaxError: f-string: unmatched '(' error in Python 3.10/3.11.
Python 3.12+ relaxed this restriction but we need compatibility with 3.10+.

Fixes Azure DevOps pipeline failures on Python 3.10 and 3.11 test matrices.
Python 3.10/3.11 do not allow backslashes inside f-string expressions.
Extract filter_value to a variable before using in f-string (line 966).

This fixes: SyntaxError: f-string expression part cannot include a backslash
@hallvictoria
hallvictoria marked this pull request as ready for review July 8, 2026 21:02
@hallvictoria
hallvictoria requested a review from a team as a code owner July 8, 2026 21:02

@daviburg daviburg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[Dobby] Generated connector output is close after latest BPM master, but it is still not reproducible from BPM without companion generator changes.

I refreshed the local BPM repo to origin/master and rebuilt the generator before re-checking:

  • BPM repo: master at 995f7065516f8b8cc455ad096383067b9ebbbb77
  • Command shape used: LogicAppsCompiler <temp> unused --directClient --language=python --connectors=box,dropbox,excelonline,ftp,googlecalendar,googledrive,googletasks,office365groupsmail,onedriveforbusiness,rss
  • ARM data source: the same westus managedApis list/export endpoints cached through ARMCACHE_PATH
  • PR head compared: 99b88e9047b64e597407e4d57290fdde5e73f857

The stale-BPM broad drift I saw earlier is mostly gone, but all 10 generated files still differ from latest BPM output. The remaining drift falls into these patterns:

  1. Python 3.10/3.11-safe generated string literals.

    Latest BPM master still emits nested same-quote f-strings such as:

    query_params.append(f"queryParametersSingleEncoded={quote("true")}")
    query_params.append(f"source={quote("me")}")
    query_params.append(f"simulate={quote("false")}")
    query_params.append(f"$expand={quote("attachments")}")

    The PR output changes these to single-quoted literals or locals, for example:

    query_params.append(f"queryParametersSingleEncoded={quote('true')}")
    query_params.append(f"source={quote('me')}")
    expand_value = "threads($select=id;$expand=posts($select=id,createdDateTime))"
    query_params.append(f"$expand={quote(expand_value)}")

    This is not just cosmetic: compiling latest BPM-generated box.py under Python 3.11 fails with SyntaxError: f-string: unmatched '(', while the PR-extracted connector files compile under Python 3.11. Since the PR/CI matrix includes Python 3.10 and 3.11, this generator fix should live in BPM rather than only in the generated SDK output.

  2. Generated import cleanup.

    Latest BPM output still emits unused imports in several generated files, commonly:

    from datetime import datetime
    from typing import Optional, Any, Dict, List

    The PR removes datetime where no generated type uses it, and in some files narrows typing imports. That is fine for the SDK files, but it is still generated-code drift unless the BPM generator owns the import tracking change.

  3. One remaining method-level delta in Google Drive.

    Latest BPM master output for googledrive.py emits get_table_async(...), but the PR also includes:

    async def get_tables_async(
        self,
        dataset: str,
    ):
        """
        Get sheets
    
        Retrieves sheet names from a Google Sheet file
        """
        path = (
            f"{self._connection_runtime_url}"
            f"/datasets/{quote(str(dataset), safe='')}/tables"
        )
        ...

    The PR samples/tests use this surface, so a future regeneration from current BPM master would drop an API this PR introduces.

Can you add/link a companion BPM repo PR that makes the Python DirectClient generator produce this PR output, then update this PR description from “No generator changes required” to the BPM PR/revision used for regeneration? I would expect the BPM-side fix to cover at least:

  • Quote/default literal emission that compiles under Python 3.10/3.11.
  • Import tracking so unused datetime/typing imports are not emitted.
  • The Google Drive get_tables_async generation gap, or an explanation/test proving why it should remain SDK-only.
  • Generator tests for the above so these edits do not need to be repeated by hand in future generated connector PRs.

@daviburg

Copy link
Copy Markdown
Member

Please regenerate all ten client modules from the corrected BPM generator revision in AzureUX-BPM PR 16382760 (validated at dc8d145a6b). The current SDK head predates the fix and still contains stale generated output. In particular, regeneration needs to carry forward the
equest_url fix for methods with a user path query parameter and expose Google Tasks as create_task_async (not craete_task_async). Please update the corresponding tests to assert the emitted/public API behavior, then rerun the Python test and lint suites.

@daviburg daviburg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Validated the regenerated output from BPM PR 16382760: path-based clients now preserve the caller value in request_url, and Google Tasks exposes create_task_async. Focused affected-client tests passed locally against this PR's source tree, and the hosted Python 3.10-3.14 matrix is green.

Follow-up suggestion: please add a regression assertion in a path-based client test (for example, test_get_file_content_by_path_success) that inspects mock_send.call_args[0][1] and verifies it contains path=/Documents/file.txt. The current tests invoke the method but only assert the response; asserting the outbound URL will prevent the original path-overwrite bug from returning.

@hallvictoria
hallvictoria merged commit ed8f5cd into main Jul 13, 2026
16 checks passed
@hallvictoria
hallvictoria deleted the hallvictoria/add-connectors-p2 branch July 13, 2026 14:49
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.

2 participants